DATACMNS-558 - Some code cleanups according to the Sonar report.
This commit is contained in:
@@ -175,10 +175,10 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
|
||||
propertyCache.put(property.getName(), property);
|
||||
}
|
||||
|
||||
P idProperty = returnPropertyIfBetterIdPropertyCandidateOrNull(property);
|
||||
P candidate = returnPropertyIfBetterIdPropertyCandidateOrNull(property);
|
||||
|
||||
if (idProperty != null) {
|
||||
this.idProperty = idProperty;
|
||||
if (candidate != null) {
|
||||
this.idProperty = candidate;
|
||||
}
|
||||
|
||||
if (property.isVersionProperty()) {
|
||||
|
||||
@@ -69,9 +69,9 @@ public class PreferredConstructorDiscoverer<T, P extends PersistentProperty<P>>
|
||||
int numberOfArgConstructors = 0;
|
||||
Class<?> rawOwningType = type.getType();
|
||||
|
||||
for (Constructor<?> constructor : rawOwningType.getDeclaredConstructors()) {
|
||||
for (Constructor<?> candidate : rawOwningType.getDeclaredConstructors()) {
|
||||
|
||||
PreferredConstructor<T, P> preferredConstructor = buildPreferredConstructor(constructor, type, entity);
|
||||
PreferredConstructor<T, P> preferredConstructor = buildPreferredConstructor(candidate, type, entity);
|
||||
|
||||
// Explicitly defined constructor trumps all
|
||||
if (preferredConstructor.isExplicitlyAnnotated()) {
|
||||
|
||||
@@ -115,15 +115,19 @@ public class SimpleTypeHolder {
|
||||
* @return
|
||||
*/
|
||||
public boolean isSimpleType(Class<?> type) {
|
||||
|
||||
Assert.notNull(type);
|
||||
|
||||
if (Object.class.equals(type)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (Class<?> clazz : simpleTypes) {
|
||||
if (type == clazz || clazz.isAssignableFrom(type)) {
|
||||
if (clazz.isAssignableFrom(type)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user