Repository navigation
Conversation
The shared tag set now includes the block tags hidden and spec and the inline tags index, summary, and systemProperty, so they are accepted on types, methods, and fields. Type comments also accept the serial block tag, and method comments also accept the inline return tag. Tests cover those accepted forms and still expect diagnostics for the module tags provides and uses, for index written as a block tag, for hidden written as an inline tag, and for return on a type. Fixes google#3913
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Javadoc that uses tags from the standard documentation comment specification is reported as invalid. A type, method, or field marked with @hidden draws a warning that the tag is not allowed on that element, and the inline tags summary, index, and systemProperty are rejected the same way. The JDK javadoc tool accepts these tags with no custom-tag configuration.
The block and inline checks allow only tags named in fixed sets, and those sets omit tags the specification added later. hidden, spec, index, summary, and systemProperty are absent from the set shared by every element kind. serial is absent from the set for types, and the inline form of return is absent from the set for methods, so each missing tag is diagnosed as disallowed.
What this changes
The shared tag set now includes the block tags hidden and spec and the inline tags index, summary, and systemProperty, so they are accepted on types, methods, and fields. Type comments also accept the serial block tag, and method comments also accept the inline return tag. Tests cover those accepted forms and still expect diagnostics for the module tags provides and uses, for index written as a block tag, for hidden written as an inline tag, and for return on a type.
How it was tested
The local test run for the error-prone change to
core/src/main/java/com/google/errorprone/bugpatterns/javadoc/JavadocTag.javacould not complete in this environment.Fixes #3913