Refactor method name dispatching to switch statements

Closes gh-25163
This commit is contained in:
Juergen Hoeller
2020-05-29 23:07:25 +02:00
parent 7207f7645c
commit e955e52f2f
15 changed files with 499 additions and 547 deletions

View File

@@ -719,16 +719,12 @@ public class MvcUriComponentsBuilder {
@Override
@Nullable
public Object intercept(Object obj, Method method, Object[] args, @Nullable MethodProxy proxy) {
if (method.getName().equals("getControllerType")) {
return this.controllerType;
switch (method.getName()) {
case "getControllerType": return this.controllerType;
case "getControllerMethod": return this.controllerMethod;
case "getArgumentValues": return this.argumentValues;
}
else if (method.getName().equals("getControllerMethod")) {
return this.controllerMethod;
}
else if (method.getName().equals("getArgumentValues")) {
return this.argumentValues;
}
else if (ReflectionUtils.isObjectMethod(method)) {
if (ReflectionUtils.isObjectMethod(method)) {
return ReflectionUtils.invokeMethod(method, obj, args);
}
else {