DATACMNS-943 - We prefer direct matches on repository query method overloads.

We now try to look up a target class method based on concrete name and parameter type before falling back on the more expensive type matches. This also eliminates the possibility of invalid method matches as described in the ticket.
This commit is contained in:
Oliver Gierke
2016-11-24 17:21:11 +01:00
parent 50f3565a99
commit 0cc17ffef4
2 changed files with 36 additions and 1 deletions

View File

@@ -245,6 +245,12 @@ class DefaultRepositoryInformation implements RepositoryInformation {
return method;
}
Method result = findMethod(baseClass, method.getName(), method.getParameterTypes());
if (result != null) {
return result;
}
for (Method baseClassMethod : baseClass.getMethods()) {
// Wrong name