JDK 11 RFR of 8202334: Update javax.lang.model.util visitors for 11

forax at univ-mlv.fr forax at univ-mlv.fr
Fri Apr 27 11:20:03 UTC 2018


----- Mail original -----
> De: "joe darcy" <joe.darcy at oracle.com>
> À: "Remi Forax" <forax at univ-mlv.fr>
> Cc: "compiler-dev" <compiler-dev at openjdk.java.net>
> Envoyé: Vendredi 27 Avril 2018 02:15:27
> Objet: Re: JDK 11 RFR of 8202334: Update javax.lang.model.util visitors for 11

> Hi Remi,
> 
> On 4/26/2018 11:13 AM, Remi Forax wrote:
>> Hi Joe,
>> As a side effect, it means that raw string literal will not appear in 11, which
>> is totally fine given a lot of things are still moving.
> 
> I wouldn't necessary conclude that. The string literals could be able to
> be supported without changes in the modeling API, which doesn't cover
> method bodies.

yes, right, forget that

> 
> Many language changes do not require updates to javax.lang.model. For
> example Project Coin's binary literals and underscores in literals
> didn't lead to any language changes and neither did "var".
> 
>>
>> I've another question, with my ASM hat becaus we have the same issue with ASM
>> API, how do you plan to introduce preview features in the Visitor API ? As a
>> separate interface, as a normal feature, as something else ?
> 
> We've discussed this a bit in the context of JEP 12: Preview Language
> and VM Features.
> 
> The JEP currently proposes terminal deprecation for API elements added
> solely to support preview features.

We doing that, add @Deprecated and we also suffix every method/field name with experimental, thus even if the method is promoted to be a real one in the next release, we allow the semantics to slightly change (because it's not the same method).

In term of warning, i think we should have a way to say that this @Deprecated is not exactly the same as the other @Deprecated(forRemoval=true) because you can not take action now and replace with another API, you have to wait the next release to do something. 

> 
> HTH,
> 
> -Joe

Rémi

>>
>> ----- Mail original -----
>>> De: "joe darcy" <joe.darcy at oracle.com>
>>> À: "compiler-dev" <compiler-dev at openjdk.java.net>
>>> Envoyé: Jeudi 26 Avril 2018 19:50:16
>>> Objet: JDK 11 RFR of 8202334: Update javax.lang.model.util visitors for 11
>>> Hello,
>>>
>>> Please review the webrev and CSR for 8202334: "Update
>>> javax.lang.model.util visitors for 11":
>>>
>>>      http://cr.openjdk.java.net/~darcy/8202334.0/
>>>      https://bugs.openjdk.java.net/browse/JDK-8202335
>>>
>>>  From the CSR:
>>>
>>>> The `javax.lang.model` API was added in Java SE 6. In each of Java SE
>>>> 7, 8, and 9, new sets of utility visitors were added for each release,
>>>> for example starting with `AbstractElementVisitor6`, types
>>>> `AbstractElementVisitor7`, `AbstractElementVisitor8`,
>>>> `AbstractElementVisitor8` were added in SE 7 and 8, respectively.
>>>> Similar patterns were followed for `ElementKindVisitor6`, and the rest
>>>> of the utility visitors.
>>>>
>>>> In Java SE 10, there were no language changes requiring new
>>>> operational behavior from the root visitors. Therefore, rather than
>>>> introducing yet another slate of visitor classes, the 9-era visitors
>>>> were updated to indicate they are appropriate for 10 as well
>>>> (CCC-8193194).
>>>>
>>>> In the absence of language changes in 11 which would require new
>>>> operational behavior from the visitors, the 9-era visitors should be
>>>> updated to indicate they are appropriate for releases 9 through 11.
>>>>
>>>> Solution
>>>> --------
>>>> Update the specification and `SupportedSourceVersion` annotations on
>>>> the 9-era visitor classes to indicate they are appropriate for release 11.
>>> Thanks,
>>>
> >> -Joe


More information about the compiler-dev mailing list