On Wed, 2 Jun 2021 15:25:16 GMT, Patrick Concannon <[email protected]>
wrote:
> Hi,
>
> Could someone please review my code for updating the code in the `java.lang`
> packages to make use of the switch expressions?
>
> Kind regards,
> Patrick
src/java.base/share/classes/java/lang/runtime/ObjectMethods.java line 366:
> 364: }
> 365: default -> throw new IllegalArgumentException(methodName);
> 366: };
I thinki it's simpler to have something like that
var handle = switch(methodName) {
...
};
return methodType != null ? new ConstantCallSite(handle) : handle;
-------------
PR: https://git.openjdk.java.net/jdk/pull/4312