DATACMNS-1008 - Reintroduced lost support for non-generic redeclarations of generic CRUD methods.

The changes for DATACMNS-854 and DATACMNS-912 dropped the support for the simpler redeclaration of generic methods like CrudRepository.save(…) which as of the changes requires to be redeclared like <T extends Foo> T save(T entity). Previously a simple redeclaration like Foo save(Foo entity) was sufficient.

This commit reintroduces the check for a direct match of the parameter types and shortcuts the more detailed check that's necessary in case of type variables being involved.

Related tickets: DATACMNS-854, DATACMNS-912.
This commit is contained in:
Oliver Gierke
2017-03-14 07:43:39 +01:00
parent d98c0df40b
commit 47d00bf696
2 changed files with 35 additions and 6 deletions

View File

@@ -419,6 +419,10 @@ class DefaultRepositoryInformation implements RepositoryInformation {
continue;
}
if (types[i].equals(parameterType)) {
continue;
}
if (!type.isAssignableFrom(parameterType) || !type.equals(methodParameterTypes[i])) {
return false;
}