[lworld] RFR: 8281336: [lworld] Remove workaround in LambdaToMethod to circumvent BootstrapMethodError
Srikanth Adayapalam
sadayapalam at openjdk.java.net
Tue Feb 8 00:35:38 UTC 2022
On Mon, 7 Feb 2022 22:42:37 GMT, Aggelos Biboudis <duke at openjdk.java.net> wrote:
> Maybe we can use the test from the the original PR?
>
> ```
> import java.util.function.Supplier;
>
> public primitive class CheckRefLambda {
> int theInteger;
>
> CheckRefLambda(int newValue){
> theInteger=newValue;
> }
>
> public Supplier<CheckRefLambda.ref> makeCopier(){
> return()->new CheckRefLambda(this.theInteger + 1);
> }
>
> public static void main(String[]args){
> CheckRefLambda rec=new CheckRefLambda(42);
> CheckRefLambda rec2=rec.makeCopier().get();
> if(rec2!=new CheckRefLambda(43)){
> throw new AssertionError("Classes should be equal");
> }
> }
> }
> ```
Much water has flown under the bridge - we have ripped out all support for ref-default classes and so the meanings of unadorned/naked names have changed. (in the original scenario the name CheckRefLambda is a primitive reference but in what you have put together, CheckRefLambda is an instance of a primitive class) This test case does not fail anymore without any changes (javac and/or runtime). Since we already have a javac test covering the PR, we should be good I would say.
-------------
PR: https://git.openjdk.java.net/valhalla/pull/631
More information about the valhalla-dev
mailing list