-
Notifications
You must be signed in to change notification settings - Fork 134
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
Added support for logsafe Arg arrays in Slf4jLogsafeArgs. #1394
Merged
bulldozer-bot
merged 13 commits into
palantir:develop
from
aioobe:fix-safe-args-warning
Jun 17, 2020
Merged
Added support for logsafe Arg arrays in Slf4jLogsafeArgs. #1394
bulldozer-bot
merged 13 commits into
palantir:develop
from
aioobe:fix-safe-args-warning
Jun 17, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
carterkozak
reviewed
Jun 11, 2020
baseline-error-prone/src/main/java/com/palantir/baseline/errorprone/Slf4jLogsafeArgs.java
Outdated
Show resolved
Hide resolved
carterkozak
reviewed
Jun 11, 2020
baseline-error-prone/src/test/java/com/palantir/baseline/errorprone/Slf4jLogsafeArgsTest.java
Show resolved
Hide resolved
Description is a little out of date now, and it needs a changelog. I'm happy to merge this once those are in :-) |
Adds the proper configuration files upon IntelliJ import of a gradle project for checkstyle and copyright. This generates the following additional files: - .idea/copyright/profiles_settings.xml - an xml file under .idea/copyright/ per copyright file under .baseline/copyright - .idea/checkstyle-idea.xml (and adds Checkstyle-IDEA to the external dependencies) if baseline-checkstyle is applied - Either .idea/codeStyleSettings.xml or a .idea/codeStyles/ folder with the contents being copied from .baseline/idea - If .baseline/idea/codeStyles is present, it will copy its contents, otherwise, it will fall back to .baseline/idea/intellij-java-palantir-style.xml as currently - The fallback is using a legacy IntelliJ format and requires closing and reopening the project to be taken into account
carterkozak
approved these changes
Jun 17, 2020
I think this needs to have develop merged into it to pick up the unit-test-14 check |
…line into fix-safe-args-warning
👍 |
Failed to load project - please reach out to #dev-foundry-infra or check Aries to debug |
This was referenced Jun 22, 2021
This was referenced Sep 15, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this PR
Slf4jLogsafeArgs
complains that anArg<?>[]
isn't a logsafe argument.After this PR
==COMMIT_MSG==
Slf4jLogsafeArgs now allows Arg<?>[] to be passed as vararg argument to logging methods.
==COMMIT_MSG==
Possible downsides?
None.
Context
Only allowing
Arg<?>[]
gets us half way. Compiler would still give the the following diagnostic warning:By following the above suggestion and casting to
Object[]
the expression is no longer ofArg<?>[]
type, hence we add support also forArg<?>[]
cast into anObject[]
.For
// BUG: Diagnostic contains: varargs method with inexact argument
to work, we can't only pick upSlf4jLogsafeArgs
diagnostics, so we add.matchAllDiagnostics()
.With
.matchAllDiagnostics()
we need to add@SuppressWarnings("deprecation")
in order to avoid diagnostics abouthasChildren
being deprecated.