Skip to content

Commit

Permalink
Use a different diagnostic message for the redundant @BugPattern.name…
Browse files Browse the repository at this point in the history
… case

PiperOrigin-RevId: 423565650
  • Loading branch information
cushon authored and Error Prone Team committed Jan 22, 2022
1 parent eda1c14 commit d284923
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,12 @@ private Optional<Description> removeName(ClassTree tree, VisitorState state) {
.findFirst()
.map(
ele ->
describeMatch(
anno,
SuggestedFixes.removeElement(ele, anno.getArguments(), state))));
buildDescription(anno)
.setMessage(
"Setting @BugPattern.name to the class name of the check is"
+ " redundant")
.addFix(
SuggestedFixes.removeElement(ele, anno.getArguments(), state))
.build()));
}
}

0 comments on commit d284923

Please sign in to comment.