Skip to content

Commit

Permalink
Fix class hierarchy safe-logging error message agreement (#2295)
Browse files Browse the repository at this point in the history
Fix class hierarchy safe-logging error message agreement
  • Loading branch information
carterkozak authored Jun 7, 2022
1 parent f70dfb6 commit 19efea8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,7 @@ public Description matchClass(ClassTree tree, VisitorState state) {
}
return buildDescription(tree)
.setMessage(String.format(
"Dangerous type: annotated '%s' but ancestors declare '%s'.",
directSafety, SafetyAnnotations.getSafety(tree, state)))
"Dangerous type: annotated '%s' but ancestors declare '%s'.", directSafety, ancestorSafety))
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1768,7 +1768,8 @@ public void testSubclassWithLenientSafety() {
"import com.palantir.logsafe.*;",
"class Test {",
" @Unsafe interface UnsafeClass {}",
" // BUG: Diagnostic contains: Dangerous type: annotated 'SAFE' but ancestors declare 'SAFE'.",
" // BUG: Diagnostic contains: "
+ "Dangerous type: annotated 'SAFE' but ancestors declare 'UNSAFE'.",
" @Safe interface SafeSubclass extends UnsafeClass {}",
"}")
.doTest();
Expand Down
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-2295.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: fix
fix:
description: Fix class hierarchy safe-logging error message agreement
links:
- https://github.com/palantir/gradle-baseline/pull/2295

0 comments on commit 19efea8

Please sign in to comment.