[jdk16] RFR: JDK-8251200: False positive messages about missing comments for serialization
Hannes Wallnöfer
hannesw at openjdk.java.net
Tue Jan 5 17:05:05 UTC 2021
On Thu, 24 Dec 2020 21:16:35 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:
> Using the `@serial` tag, a class can explicitly opt-in to being documented on the serialized form page. However, a class that does not want to opt-in should not be required to have a doc comment, and should not trigger the "missing comment" warning if there is no comment.
>
> The fix is to check for the presence of the comment on a class before analyzing it to see if it contains `@serial` tags.
>
> The code in `Utils.getDocCommentTree0` is slightly refactored to allow a new predicate `hasDocCommentTree` to be added.
Looks good, apart from two typos in a comment.
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java line 2689:
> 2687:
> 2688: /**
> 2689: * Checks whether an element has an associated doc copmment.
typo: copmment
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java line 2691:
> 2689: * Checks whether an element has an associated doc copmment.
> 2690: * @param element the element
> 2691: * @return {@code true} if the eleme nt has a comment, and false otherwise
typo: eleme nt
-------------
Marked as reviewed by hannesw (Reviewer).
PR: https://git.openjdk.java.net/jdk16/pull/70
More information about the javadoc-dev
mailing list