-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8314448: Coordinate DocLint and JavaDoc to report on unknown tags #15345
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
Conversation
Tag name cannot contain `@`. This is likely a leftover from the previous doclet incarnation, the one that was before cf406de.
Sure, that check could be more performant, but it will also be less readable. The commit also fixes a test that used a nonconforming taglet.
allTaglets' keys already contain all standardTags; as a bonus that also allows us to get rid of null check.
Ensures that _exactly one_ of them reports an unknown tag. Again: not both, not neither.
This is how it should've been done in 8314213 (6f1071f) initially.
|
👋 Welcome back prappo! A progress list of the required criteria for merging this PR into |
|
@pavelrappo The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
| String name = switch (tag.getKind()) { | ||
| case UNKNOWN_INLINE_TAG -> ((InlineTagTree) tag).getTagName(); | ||
| case UNKNOWN_BLOCK_TAG -> ((BlockTagTree) tag).getTagName(); | ||
| default -> tag.getKind().tagName; | ||
| }; | ||
| if (name == null) { | ||
| continue; | ||
| continue; // not a tag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is room for future evolution of the DocTree API here.
|
@pavelrappo This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 4 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
|
/integrate |
|
Going to push as commit aecbb1b.
Your commit was automatically rebased without conflicts. |
|
@pavelrappo Pushed as commit aecbb1b. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Please review this bug fix for reporting on unknown javadoc tags.
Aside from a somewhat irrelevant test for DocLint1, there are no direct tests for reporting on unknown javadoc tags. That reporting, as it turns out, is ridden with bugs. This PR fixes quite a few of those bugs and adds missing tests.
Note, that a test for miscased tags (i.e. "{0} is an unknown tag -- same as a known tag except for case") is not added, as the matching mechanism is to be superseded by a more general one, based on a string distance function, in JDK-8288660.
Also note, that while javadoc emits a warning on an unknown tag, DocLint emits an error. I haven't changed warning to error in javadoc for (better) backward compatibility. This way, an unknown tag won't fail javadoc run (unless of course
-Werroris specified). That said, in the future this decision may be revised.Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15345/head:pull/15345$ git checkout pull/15345Update a local copy of the PR:
$ git checkout pull/15345$ git pull https://git.openjdk.org/jdk.git pull/15345/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15345View PR using the GUI difftool:
$ git pr show -t 15345Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15345.diff
Webrev
Link to Webrev Comment
Footnotes
test/langtools/tools/doclint/CustomTagTest.java ↩