hg: valhalla/valhalla: 8221699: [lworld] Implement temporary alternative IDE-compatible annotation for "value" keyword
Srikanth
srikanth.adayapalam at oracle.com
Wed Apr 10 05:51:45 UTC 2019
On 09/04/19 4:22 AM, Remi Forax wrote:
> Hi Srikanth,
> that's great !
>
> may i ask for the the support of anonymous value class by adding the target ElementType.TYPE_USE,
> new @__value__ AnInterface() {
> ...
> }
Hi Remi,
Thanks for the note. I'll sheepishly admit that given the temporary
nature of this annotation support, in order to minimize changes I was
opting for a slightly hackish solution that mutates the @__vaue__
annotation into the value modifier keyword during parsing itself. The
various value semantic checks are scattered all over the place and
annotations get processed slightly late in the normal scheme of things -
which would meant that I move all those checks to post annotation
processing - a complex and messy change. The effect of this
implementation choice was that the code you cited would already compile
and the anonymous class would have been marked as a value class - but
the present push also makes the @__value__ annotation target TYPE_USE
making it internally consistent FWIW.
Thanks!
Srikanth
> cheers,
> Rémi
>
> ----- Mail original -----
>> De: "Srikanth" <srikanth.adayapalam at oracle.com>
>> À: "valhalla-dev" <valhalla-dev at openjdk.java.net>
>> Envoyé: Lundi 8 Avril 2019 14:56:56
>> Objet: hg: valhalla/valhalla: 8221699: [lworld] Implement temporary alternative IDE-compatible annotation for "value"
>> keyword
>> Changeset: d70134da3046
>> Author: sadayapalam
>> Date: 2019-04-08 18:26 +0530
>> URL: http://hg.openjdk.java.net/valhalla/valhalla/rev/d70134da3046
>>
>> 8221699: [lworld] Implement temporary alternative IDE-compatible annotation for
>> "value" keyword
>>
>> + src/java.base/share/classes/java/lang/__value__.java
>> ! src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java
>> ! src/jdk.compiler/share/classes/com/sun/tools/javac/util/Names.java
>> ! test/langtools/tools/javac/diags/CheckResourceKeys.java
>> + test/langtools/tools/javac/valhalla/lworld-values/ValueAnnotationTest.java
>> + test/langtools/tools/javac/valhalla/lworld-values/ValueAnnotationTest.out
More information about the valhalla-dev
mailing list