Skip to content

fix: accept standard Javadoc tags the block and inline checks reject - #6366

Open
mvanhorn wants to merge 1 commit into
google:masterfrom
mvanhorn:fix/3913-accept-standard-javadoc-tags
Open

mvanhorn wants to merge 1 commit into
google:masterfrom
mvanhorn:fix/3913-accept-standard-javadoc-tags

Conversation

@mvanhorn

Copy link
Copy Markdown

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.java could not complete in this environment.

Fixes #3913

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

No deployments
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.

Missing standard Javadoc tags

1 participant