Revert use of yield in switch expressions due to Eclipse compiler error
See gh-31531
This commit is contained in:
@@ -720,20 +720,26 @@ public class MvcUriComponentsBuilder {
|
||||
@Override
|
||||
@Nullable
|
||||
public Object intercept(@Nullable Object obj, Method method, Object[] args, @Nullable MethodProxy proxy) {
|
||||
return switch (method.getName()) {
|
||||
case "getControllerType" -> this.controllerType;
|
||||
case "getControllerMethod" -> this.controllerMethod;
|
||||
case "getArgumentValues" -> this.argumentValues;
|
||||
switch (method.getName()) {
|
||||
case "getControllerType" -> {
|
||||
return this.controllerType;
|
||||
}
|
||||
case "getControllerMethod" -> {
|
||||
return this.controllerMethod;
|
||||
}
|
||||
case "getArgumentValues" -> {
|
||||
return this.argumentValues;
|
||||
}
|
||||
default -> {
|
||||
if (ReflectionUtils.isObjectMethod(method)) {
|
||||
yield ReflectionUtils.invokeMethod(method, obj, args);
|
||||
return ReflectionUtils.invokeMethod(method, obj, args);
|
||||
}
|
||||
else {
|
||||
this.controllerMethod = method;
|
||||
this.argumentValues = args;
|
||||
Class<?> returnType = method.getReturnType();
|
||||
try {
|
||||
yield (returnType == void.class ? null : returnType.cast(initProxy(returnType, this)));
|
||||
return (returnType == void.class ? null : returnType.cast(initProxy(returnType, this)));
|
||||
}
|
||||
catch (Throwable ex) {
|
||||
throw new IllegalStateException(
|
||||
@@ -741,7 +747,7 @@ public class MvcUriComponentsBuilder {
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user