Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve AnnotationLiteral javadoc #657

Merged

Conversation

Ladicek
Copy link
Contributor

@Ladicek Ladicek commented Mar 7, 2023

Fixes #656

@Ladicek Ladicek added this to the CDI 4.1/5.0 milestone Mar 7, 2023
@@ -38,6 +38,7 @@
*
* <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
Contributor

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
Contributor 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
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
Contributor 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
Contributor 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
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