Skip to content
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

JDK-8272374: doclint should report missing "body" comments #5106

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,9 @@ public Void scan(DocCommentTree tree, TreePath p) {
reportMissing("dc.empty.comment");
return null;
} else {
DocTree firstTag = tree.getBlockTags().get(0);
// Don't report an empty description if the comment begins with @deprecated,
// Don't report an empty description if the comment contains @deprecated,
// because javadoc will use the content of that tag in summary tables.
if (firstTag.getKind() != DocTree.Kind.DEPRECATED) {
if (tree.getBlockTags().stream().allMatch(t -> t.getKind() != DocTree.Kind.DEPRECATED)) {
env.messages.report(MISSING, Kind.WARNING, tree, "dc.empty.description");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to not use reportMissing here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't have the right signature. reportMissing reports a missing comment on an element; here, we're reporting a missing description within a DocTree. There's a similar occurrence at line 1214.

}
}
Expand Down