DATADOC-270 - Removed critical Sonar warnings from codebase.

This commit is contained in:
Oliver Gierke
2011-09-14 15:34:29 +02:00
parent 5dab0c721e
commit 73b2d5a99c
7 changed files with 143 additions and 143 deletions

View File

@@ -35,10 +35,10 @@ public class CannotGetMongoDbConnectionException extends DataAccessResourceFailu
super(msg);
}
public CannotGetMongoDbConnectionException(String msg, String database, String username, char[] password2) {
public CannotGetMongoDbConnectionException(String msg, String database, String username, char[] password) {
super(msg);
this.username = username;
this.password = password2;
this.password = password == null ? null : password.clone();
this.database = database;
}

View File

@@ -866,7 +866,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware {
} else {
commandResult = executeCommand(commandObject);
}
commandResult.throwOnError();
commandResult.throwOnError();
} catch (RuntimeException ex) {
this.potentiallyConvertRuntimeException(ex);
}
@@ -1277,7 +1277,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware {
if (entityClass == null) {
throw new InvalidDataAccessApiUsageException(
"No class parameter provided, entity collection can't be determined for " + entityClass);
"No class parameter provided, entity collection can't be determined!");
}
MongoPersistentEntity<?> entity = mappingContext.getPersistentEntity(entityClass);

View File

@@ -100,9 +100,8 @@ public class QueryMapper {
newConditions.add(getMappedObject((DBObject) iter.next(), entity));
}
value = newConditions;
} else {
// TODO: Implement other forms of conversion (like @Alias and whatnot)
}
newDbo.put(newKey, value);
}
return newDbo;

View File

@@ -200,7 +200,7 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App
spelCtx.setBeanResolver(new BeanFactoryResolver(applicationContext));
}
if (!(dbo instanceof BasicDBList)) {
String[] keySet = dbo.keySet().toArray(new String[] {});
String[] keySet = dbo.keySet().toArray(new String[dbo.keySet().size()]);
for (String key : keySet) {
spelCtx.setVariable(key, dbo.get(key));
}

View File

@@ -51,6 +51,6 @@ public class Circle {
@Override
public String toString() {
return String.format("Circle [center=%s, radius=%d]", center, radius);
return String.format("Circle [center=%s, radius=%f]", center, radius);
}
}

View File

@@ -25,7 +25,7 @@ public class OrCriteria implements CriteriaDefinition {
public OrCriteria(Query[] queries) {
super();
this.queries = queries;
this.queries = queries == null ? null : queries.clone();
}
/*