Java: exclude writeReplace-defining classes from Serializable check#18415
Merged
smowton merged 4 commits intogithub:mainfrom Jan 7, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot reviewed 2 out of 5 changed files in this pull request and generated 1 comment.
Files not reviewed (3)
- java/ql/src/Likely Bugs/Serialization/MissingVoidConstructorsOnSerializable.ql: Language not supported
- java/ql/test/query-tests/MissingVoidConstructorsOnSerializable/MissingVoidConstructorsOnSerializable.expected: Language not supported
- java/ql/test/query-tests/MissingVoidConstructorsOnSerializable/MissingVoidConstructorsOnSerializable.qlref: Language not supported
Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more
java/ql/test/query-tests/MissingVoidConstructorsOnSerializable/Test.java
Outdated
Show resolved
Hide resolved
Contributor
Author
|
@igfoo fixed; please re-approve |
owen-mc
approved these changes
Jan 7, 2025
Contributor
owen-mc
left a comment
There was a problem hiding this comment.
Proxying previous approval
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.
#18371 notes that it is a common pattern to define
writeReplaceand thereby avoid needing to meet the default algorithm's requirements ofSerializable-tagged classes.This is imprecise since in general the defining class might show up in an object stream anyhow (old version; writeReplace that sometimes keeps the original object or another of the same type; etc), but the query is of low importance anyhow so I went for a low-effort fix. This should simply reduce noise for people using the security-and-quality suite.