Skip to content

Improve AnnotationLiteral javadoc#657

Merged
Ladicek merged 1 commit intojakartaee:masterfrom
Ladicek:improve-annotation-literal-javadoc
May 24, 2023
Merged

Improve AnnotationLiteral javadoc#657
Ladicek merged 1 commit intojakartaee:masterfrom
Ladicek:improve-annotation-literal-javadoc

Conversation

@Ladicek
Copy link
Copy Markdown
Member

@Ladicek Ladicek commented Mar 7, 2023

Fixes #656

@Ladicek Ladicek added this to the CDI 4.1/5.0 milestone Mar 7, 2023
*
* <p>
* An instance of an annotation type may be obtained by subclassing <code>AnnotationLiteral</code>.
* The subclass must implement the annotation interface to satisfy the {@link Annotation} contract.
Copy link
Copy Markdown
Contributor

@Emily-Jiang Emily-Jiang May 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* The subclass must implement the annotation interface to satisfy the {@link Annotation} contract.
* The subclass must implement the corresponding annotation interface to satisfy the {@link Annotation} contract.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would actually be incorrect. This refers to the annotation interface for which the AnnotationLiteral is being created. So if I have an annotation type MyAnnotation and I'm creating an AnnotationLiteral for it, the AnnotationLiteral subclass must implement MyAnnotation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, you were right. I updated the above comments to clarify that. WDYT?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I could do is replace "annotation interface" with "annotation type", as "annotation type" is used above this sentence. However, "the subclass must implement the annotation type" is not exactly clear in that "implement" means the implements keyword...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous sentence, on the previous line, says

An instance of an annotation type may be obtained by subclassing AnnotationLiteral.

The sentence that is being added here refers to that annotation type.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, okay. It makes sense! Thanks for your explanation!

@Ladicek Ladicek merged commit 96cd940 into jakartaee:master May 24, 2023
@Ladicek Ladicek deleted the improve-annotation-literal-javadoc branch May 24, 2023 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve AnnotationLiteral javadoc

4 participants