DangerousRecordArrayField - Fix false positive on static array fields#171
Open
schlosna wants to merge 1 commit into
Open
DangerousRecordArrayField - Fix false positive on static array fields#171schlosna wants to merge 1 commit into
schlosna wants to merge 1 commit into
Conversation
The check was incorrectly flagging records with static array fields. Static fields don't participate in record's auto-generated equals() and hashCode() methods, so they shouldn't trigger the warning. Added unit tests to verify static fields are properly ignored.
Generate changelog in
|
✅ Successfully generated changelog entry!Need to regenerate?Simply interact with the changelog bot comment again to regenerate these entries. 📋Changelog Preview🐛 Fixes
|
1 similar comment
✅ Successfully generated changelog entry!Need to regenerate?Simply interact with the changelog bot comment again to regenerate these entries. 📋Changelog Preview🐛 Fixes
|
pkoenig10
approved these changes
Apr 9, 2026
Comment on lines
34
to
36
| /** | ||
| * Warns that users should not have a {@link java.util.regex.Pattern} as a key to a Set or Map. | ||
| */ |
Member
There was a problem hiding this comment.
Not this PR, but while you're here would you mind either fixing or removing this Javadoc? It looks like it was copied from DangerousIdentityKey.
Probably should also fix the Javadoc in DangerousIdentityKey, since it checks for more than just java.util.regex.Pattern.
This file contains hidden or 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
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
The check was incorrectly flagging records with static array fields.
After this PR
==COMMIT_MSG==
Static fields don't participate in record's auto-generated equals() and hashCode() methods, so they shouldn't trigger the warning. Added unit tests to verify static fields are properly ignored.
==COMMIT_MSG==
Possible downsides?