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 8fabba5aa3
commit fbd560ee4f
2 changed files with 37 additions and 1 deletions

View File

@@ -246,6 +246,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