Merge branch 'main' into post-release-prep/codeql-cli-2.20.1

This commit is contained in:
Owen Mansel-Chan
2025-01-08 16:28:23 +00:00
committed by GitHub
211 changed files with 22830 additions and 10264 deletions

View File

@@ -24,6 +24,16 @@ where
c.hasNoParameters() and
not c.isPrivate()
) and
// Assume if an object replaces itself prior to serialization,
// then it is unlikely to be directly deserialized.
// That means it won't need to comply with default serialization rules,
// such as non-serializable super-classes having a no-argument constructor.
not exists(Method m |
m = serial.getAMethod() and
m.hasName("writeReplace") and
m.getReturnType() instanceof TypeObject and
m.hasNoParameters()
) and
serial.fromSource()
select serial,
"This class is serializable, but its non-serializable " +

View File

@@ -0,0 +1,4 @@
---
category: fix
---
* Classes that define a `writeReplace` method are no longer flagged by the `java/missing-no-arg-constructor-on-serializable` query on the assumption they are unlikely to be deserialized using the default algorithm.