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

Fix class hierarchy safe-logging error message agreement #2295

Merged
merged 2 commits into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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 @@ -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'.",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

apparently I didn't read this very well and copy/pasted :-(

Copy link
Contributor

Choose a reason for hiding this comment

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

Woops, also slipped through review 🙈

" // 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