[jdk19] RFR: 8287379: Using @inheritDoc in an inapplicable context shouldn't crash javadoc [v4]
Pavel Rappo
prappo at openjdk.org
Mon Jul 4 19:25:17 UTC 2022
> This rights the wrongs of JDK-8008768. For more information, see the respective CSR.
Pavel Rappo has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 11 commits:
- Merge remote-tracking branch 'jdk19/master' into 8287379
- feedback: make method positive
- Merge remote-tracking branch 'jdk19/master' into 8287379
- Update DocTest
1. Removes @inheritDoc from these type of declarations:
* class and interface
* constructor
2. Removes empty declarations.
3. Updates @apiNote, @implSpec and @implNote definitions to match those
of JDK API.
4. Fixes a few typos.
- Add tests
- Disallow @inheritDoc in type declarations
This undoes undocumented changes introduced by 8008768.
- Do not warn on inline misuse
The type of a declaration (module, class or interface, constructor,
method, etc.) for which a tag is applicable, is orthogonal to the type
of the tag (inline, block, bimodal).
The code up the stack knows which type of tags it has collected. If
those tags are of type other than expected, it's a programming error.
- Doclint shouldn't warn on inapplicable conditions
overview.html and doc-files/**/*.html files cannot have
a main description or be an empty comment. At the very least,
the check for being "an empty comment" for such files cannot be
performed by checking if the files contain any block tags. Block tags
are applicable to a program element, which those files are not.
- Expand checkTags to include non-inline tag
Aside from @inheritDoc, which is context-dependent, we now have
a bimodal tag such as {@return}/@return.
- Remove another null-check
The `element` cannot be null for various reasons:
1. If `element` were null, `getCommentHelper` would NPE (because it
calls `Utils.getDocCommentInfo` which NPEs on a null element).
2. The Overview and Html files correspond to the OverviewElement
and DocFileElement pseudo-elements, which are passed to checkTags
when respective files are processed.
Existing tests and ad-hoc experiments support that.
- ... and 1 more: https://git.openjdk.org/jdk19/compare/f640fc5a...b6e2df83
-------------
Changes: https://git.openjdk.org/jdk19/pull/54/files
Webrev: https://webrevs.openjdk.org/?repo=jdk19&pr=54&range=03
Stats: 499 lines in 17 files changed: 193 ins; 234 del; 72 mod
Patch: https://git.openjdk.org/jdk19/pull/54.diff
Fetch: git fetch https://git.openjdk.org/jdk19 pull/54/head:pull/54
PR: https://git.openjdk.org/jdk19/pull/54
More information about the javadoc-dev
mailing list