Initial JDK 11 RFR of JDK-8173382: Add -source 11 and -target 11 to javac - Java Bug System & JDK-8193291: Add SourceVersion.RELEASE_11
Joseph D. Darcy
joe.darcy at oracle.com
Tue Dec 19 01:49:42 UTC 2017
I'm doing final checks and preparations of fixes to
JDK-8173382: Add -source 11 and -target 11 to javac
JDK-8193291: Add SourceVersion.RELEASE_11
and expect to push shortly.
On 12/18/2017 5:42 PM, Paul Sandoz wrote:
> Looks good to me.
> I am including HS dev for the class file version changes:
> We can push the above patches under the following issue rather that
> merge into Joe's patch:
> Hopefully by the next release we can merge together and with less
> changes required.
>> On 18 Dec 2017, at 17:33, Joseph D. Darcy <joe.darcy at oracle.com
>> <mailto:joe.darcy at oracle.com>> wrote:
>> A follow-up on defining a final field RELEASE_CURRENT as an alias
>> for the latest SourceVersion constant to allow easier updating of
>> annotations using SourceVersion constants. Somewht surprisingly, this
>> is not legal Java code; an annotation must use an enum constant
>> directly and not a constant expression which evaluates to an enum
>> This rules is given in JLS 9.7.1 Normal Annotations:
>>> T [ the element type] is not an array type, and the type of V [the
>>> element value] is assignment compatible (§5.2) with T, and:
>>> If T is a primitive type or String, then V is a constant
>>> expression (§15.28).
>>> If T is Class or an invocation of Class (§4.5), then V is a class
>>> literal (§15.8.2).
>>> If T is an enum type (§8.9), then V is an enum constant (§8.9.1).
>>> V is not null.
>> The wording goes back to JLS 3rd edition which introduced enums and
>> Formally, the constant expression concept in JLS 15.28 only applies
>> to primitive types and Strings. Presumably, it would not be too
>> difficult to expand this concept to include class literals and enum
>> In any case, in the mean time the suggested idiom will not work and
>> the changes of RELEASE_9 => RELEASE_10 will need to stay.
>> Updated webrev with a minor merge:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the compiler-dev