DATAMONGO-635 - Fixed some Sonar warnings.

This commit is contained in:
Oliver Gierke
2013-03-25 18:13:08 +01:00
parent 4dcec1f6e2
commit 8e01f95b29
2 changed files with 8 additions and 2 deletions

View File

@@ -832,7 +832,7 @@ public class MappingMongoConverter extends AbstractMongoConverter implements App
return conversionService.convert(obj, target);
}
if (null != obj && conversions.isSimpleType(obj.getClass())) {
if (conversions.isSimpleType(obj.getClass())) {
// Doesn't need conversion
return getPotentiallyConvertedSimpleWrite(obj);
}

View File

@@ -264,7 +264,13 @@ public abstract class AbstractMongoQuery implements RepositoryQuery {
private boolean isListOfGeoResult() {
TypeInformation<?> returnType = method.getReturnType();
return returnType.getType().equals(List.class) && GeoResult.class.equals(returnType.getComponentType());
if (!returnType.getType().equals(List.class)) {
return false;
}
TypeInformation<?> componentType = returnType.getComponentType();
return componentType == null ? false : GeoResult.class.equals(componentType.getType());
}
}
}