-
Notifications
You must be signed in to change notification settings - Fork 135
Ignore non-literal arg names in LogsafeArgName #1465
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
Conversation
Generate changelog in
|
| .addFix(builder.replace(tree.getMethodSelect(), unsafeArg + ".of") | ||
| .build()) | ||
| .build(); | ||
| if (argNameExpression instanceof JCTree.JCLiteral) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we might as well combine these two conditional expressions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can just get rid of the compile time constant matcher, right? All literals are compile time constants.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, you're right
|
Released 3.36.1 |
Before this PR
The
LogsafeArgNamecheck would fail if using a compile time constant identifier (static final variables) for args names.This fails with the following exception:
After this PR
The
LogsafeArgNameignores arg names that are not literals.