Browse Source

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.
pull/347/head
Oliver Gierke 9 years ago
parent
commit
e1ad4ebe5b
  1. 12
      src/main/java/org/springframework/data/repository/core/support/DefaultRepositoryInformation.java

12
src/main/java/org/springframework/data/repository/core/support/DefaultRepositoryInformation.java

@ -397,17 +397,7 @@ class DefaultRepositoryInformation implements RepositoryInformation { @@ -397,17 +397,7 @@ class DefaultRepositoryInformation implements RepositoryInformation {
Type boundType = variable.getBounds()[0];
String referenceName = boundType instanceof TypeVariable ? boundType.toString() : variable.toString();
boolean isDomainTypeVariableReference = DOMAIN_TYPE_NAME.equals(referenceName);
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;
return DOMAIN_TYPE_NAME.equals(referenceName) && parameterType.isAssignableFrom(entityType);
}
for (Type type : variable.getBounds()) {

Loading…
Cancel
Save