Interim JDK 10 RFR of 8187951: Update javax.lang.model.SourceVersion for "var" name

Joseph D. Darcy joe.darcy at oracle.com
Thu Oct 12 00:57:32 UTC 2017


Hi Jon,

Catching up post-JavaOne...

On 9/29/2017 11:12 AM, Jonathan Gibbons wrote:
>
> Joe,
>
> I guess I would ask, who are these methods targeted at?
>
> Both isIdentifier and isKeyword are fuzzy at best.
>
> isIdentifier does not take the appropriate Unicode standard into 
> account, although it is probably "good enough".
>

Right; specifically it doesn't use the Unicode standard that was in 
force at the time of the earlier releases. Each major JDK platform 
release generally bumps the supported Unicode version and set of 
identifier characters expands. To be 100% accurate the isIdentifier 
check on release (N - k) for some k > 0 would need the Unicode tables 
used on JDK (N - k). That information is not available via the platform 
APIs.

> isKeyword has certainly become more complex in 9 and after, and anyone 
> who really needs this info (e.g. IDEs) is probably already doing it 
> for themselves, properly.
>
> Do you have any reasonable use-cases for a fuzzy definition of 
> isKeyword, or should we just deprecate it words the Big Bit Bucket in 
> the sky?
>

My thought was for annotation processor authors to have some easy ways 
to verify a name was valid to use on a given source version, etc.

I agree tools like IDEs will need more precise implementations of such 
checks, but I think there is still benefit in providing less formal 
checking too.

-Joe

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20171011/5a96f3ec/attachment-0001.html>


More information about the compiler-dev mailing list