DATACMNS-923 - Removed obsolete code in DefaultRepositoryInformation.

The special case of an Iterable parameter doesn't have to be handled explicitly anymore so that we can simplify the type match check in DefaultRepositoryInformation.

Related ticket: DATACMNS-912.
This commit is contained in:
Oliver Gierke
2016-09-28 17:25:51 +02:00
parent 7ae5b66101
commit 5d097db09e

View File

@@ -397,17 +397,7 @@ class DefaultRepositoryInformation implements RepositoryInformation {
Type boundType = variable.getBounds()[0]; Type boundType = variable.getBounds()[0];
String referenceName = boundType instanceof TypeVariable ? boundType.toString() : variable.toString(); String referenceName = boundType instanceof TypeVariable ? boundType.toString() : variable.toString();
boolean isDomainTypeVariableReference = DOMAIN_TYPE_NAME.equals(referenceName); return DOMAIN_TYPE_NAME.equals(referenceName) && parameterType.isAssignableFrom(entityType);
boolean parameterMatchesEntityType = parameterType.isAssignableFrom(entityType);
// We need this check to be sure not to match save(Iterable) for entities implementing Iterable
boolean isNotIterable = !parameterType.equals(Iterable.class);
if (isDomainTypeVariableReference && parameterMatchesEntityType && isNotIterable) {
return true;
}
return false;
} }
for (Type type : variable.getBounds()) { for (Type type : variable.getBounds()) {