RFR: 8336754: Remodel TypeAnnotation to "has" instead of "be" an Annotation [v8]
Alex Buckley
alex.buckley at oracle.com
Fri Aug 2 15:53:49 UTC 2024
In the annotation `@Foo(a=1)`, the left hand side `a` is an _element_
(as declared in the annotation interface Foo) and the right hand side
`1` is an _element value_ (per the first line of JLS 9.7.1).
Syntactically the `a` is an identifier but that's almost never relevant
what discussing element-value pairs. In the text you quoted, "an array
element of an array-valued element `value`" is the right way to say it.
Alex
On 8/2/2024 8:45 AM, Chen Liang wrote:
> One specification question for Alex: we call an annotation interface's
> element "element". What about the element-value pair that binds a value
> to an interface element in an annotation? Can we call this element-value
> pair an "element", or is there any other more proper name that is still
> concise? For context:
> > [This annotation] is an array element of an array-valued element
> named {@code value} in a container annotation
>
> ------------------------------------------------------------------------
> *From:* core-libs-dev <core-libs-dev-retn at openjdk.org> on behalf of Adam
> Sotona <asotona at openjdk.org>
> *Sent:* Friday, August 2, 2024 8:55 AM
> *To:* compiler-dev at openjdk.org <compiler-dev at openjdk.org>;
> core-libs-dev at openjdk.org <core-libs-dev at openjdk.org>;
> javadoc-dev at openjdk.org <javadoc-dev at openjdk.org>
> *Subject:* Re: RFR: 8336754: Remodel TypeAnnotation to "has" instead of
> "be" an Annotation [v8]
> On Fri, 2 Aug 2024 00:04:48 GMT, Chen Liang <liach at openjdk.org> wrote:
>
>>> `TypeAnnotation` is not an annotation, as it should not be used in places like `AnnotationValue.ofAnnotation`. Thus it's remodeled to contain an annotation at a given location instead of to be an annotation.
>>>
>>> Depends on #20205.
>>
>> Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 12 additional commits since the last revision:
>>
>> - remove compile, use element-value, break long sentences
>> - Merge branch 'master' of https://github.com/openjdk/jdk <https://github.com/openjdk/jdk> into
> fix/typeanno-model
>> - Improve docs for repeating, default, and value name
>> - Merge branch 'master' of https://github.com/openjdk/jdk <https://github.com/openjdk/jdk> into
> fix/typeanno-model
>> - Merge branch 'master' of https://github.com/openjdk/jdk <https://github.com/openjdk/jdk> into
> fix/typeanno-model
>> - More refinements from alex
>> - Artifact -> construct
>> - More about Annotation, add equals note
>> - Further refine wording
>> - Refine the spec of TypeAnnotation per Alex feedback
>> - ... and 2 more: https://git.openjdk.org/jdk/compare/f3707e9b...3a91a3a5
> <https://git.openjdk.org/jdk/compare/f3707e9b...3a91a3a5>
>
> Marked as reviewed by asotona (Reviewer).
>
> -------------
>
> PR Review:
> https://git.openjdk.org/jdk/pull/20247#pullrequestreview-2215642863
> <https://git.openjdk.org/jdk/pull/20247#pullrequestreview-2215642863>
More information about the compiler-dev
mailing list