JDK 9 RFR of JDK-6415644 Make javax.lang.model.SourceVersion more informative

Jonathan Gibbons jonathan.gibbons at oracle.com
Tue May 17 21:10:55 UTC 2016


That being said,  the implementation does not appear to give what might 
be considered correct answers to
     isKeyword("assert", SourceVersion.RELEASE0);
     isKeyword("enum", SourceVersion.RELEASE0);

I can't help feeling that the body of isKeyword is likely to evolve into 
a strings-in-switch ;-)

-- Jon

On 05/17/2016 01:11 PM, Jonathan Gibbons wrote:
> Looks OK to me.
>
> You could micro-optimize these lines
>
>  318         String id = s.toString();
>  319         if ("_".equals(id)) {
>
> to use .contentEquals and aboid a possibly unnecessary .toString().
>
> -- Jon
>
>
>
> On 05/17/2016 11:48 AM, joe darcy wrote:
>> Hello,
>>
>> Please review this webrev to add some version-sensitive keyword and 
>> name queries:
>>
>>     JDK-6415644 Make javax.lang.model.SourceVersion more informative
>>
>>     http://cr.openjdk.java.net/~darcy/6415644.0/
>>
>> Thanks,
>>
>> -Joe
>>
>



More information about the compiler-dev mailing list