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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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!

* </p>
*
* <pre>
Expand Down