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

safe-logging analysis correctly handles out-of-scope parameter references #2988

Merged
merged 4 commits into from
Jan 9, 2025

Conversation

carterkozak
Copy link
Contributor

@carterkozak carterkozak commented Jan 8, 2025

Reported in #2984

==COMMIT_MSG==
safe-logging analysis correctly handles out-of-scope parameter references
==COMMIT_MSG==

Note that this has also been updated to improve the isPatternBinding check using java 17 target compatibility now that we've upgraded.
This should dramatically improve performance in areas which reference parameters in lambdas as well, as we can avoid an additional set of compilations :-)

@carterkozak carterkozak requested a review from mpritham January 8, 2025 16:17
// JCBindingPattern is newer than our compilation target, so we match strings to avoid
// complex build-system configurations.
String kindString = enclosing.getKind().name();
return "BINDING_PATTERN".equals(kindString);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure why I originally checked for an enclosing binding pattern instead of the binding variable type before, most likely searching in the dark based on older jdk-11 sources

@ash211
Copy link
Contributor

ash211 commented Jan 9, 2025

Looks like this would catch some log safety issues in my repo. Looking forward to having this additional protection land!

Copy link
Contributor

@mpritham mpritham left a comment

Choose a reason for hiding this comment

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

Thanks!

@bulldozer-bot bulldozer-bot bot merged commit 20880cf into develop Jan 9, 2025
5 checks passed
@bulldozer-bot bulldozer-bot bot deleted the ckozak/safe_logging_param_out_of_scope branch January 9, 2025 21:29
@autorelease3
Copy link

autorelease3 bot commented Jan 9, 2025

Released 6.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants