State of javac support for lworld-values.

forax at univ-mlv.fr forax at univ-mlv.fr
Mon Mar 26 11:36:37 UTC 2018



----- Mail original -----
> De: "Srikanth" <srikanth.adayapalam at oracle.com>
> À: "Remi Forax" <forax at univ-mlv.fr>
> Cc: "Karen Kinnear" <karen.kinnear at oracle.com>, "John Rose" <john.r.rose at oracle.com>, "valhalla-dev"
> <valhalla-dev at openjdk.java.net>
> Envoyé: Lundi 26 Mars 2018 13:28:04
> Objet: Re: State of javac support for lworld-values.

> On Monday 26 March 2018 04:41 PM, Remi Forax wrote:
>> I agree with Srikanth, if we want to test the compatibility, the best is to
>> compile the same way the code will be compiled in real life.
>>
>> Does the sample below emits the same error ?
>>    if (y != x) {}
> 
> Is that a trick question ??
> 
> Yes, I get the same error for all lines in:
> 
>  Object o = null;
>        if (x == y) {}
>         if (y == x) {}
>         if (x != y) {}
>         if (y != x) {}
>         if (x == x) {}
>         if (x != x) {}
>         if (x == o) {}
>         if (o == x) {}
>         if (x != o) {}
>         if (o != x) {}
> 
> (the error for x == x and x != x read odd, but they are unlikely in
> practice)

ok, great !

> 
>> (4) in my opinion, should be solved by introducting in 11 of a serie of new
>> warnings for the class that are marked as value based class.
>>      All the errors on value types should be warnings on the value based class.
> 
> Thanks, I'll wait for any comments on the risks of whether this could be
> misconstrued as a promise/guarantee of imminent release of value types
> and if not, propose it for jdk11.

Technically, it's enforcing the rules for value based classes written in the javadoc at javac level,
so even if value types are never integrated in Java, these warnings makes Java safer. 

> 
> Thanks!
> Srikanth

cheers,
Rémi


More information about the valhalla-dev mailing list