Merge pull request #11299 from tamasvajk/kotlin-nested-serializable

Kotlin: Exclude .kt files from serializable inner class query
This commit is contained in:
Tamás Vajk
2022-11-16 16:22:13 +01:00
committed by GitHub
4 changed files with 13 additions and 1 deletions

View File

@@ -77,7 +77,7 @@ predicate exceptions(NestedClass inner) {
from NestedClass inner, Class outer, string advice
where
inner.fromSource() and
inner.getFile().isJavaSourceFile() and
isSerializable(inner) and
outer = enclosingInstanceType+(inner) and
not isSerializable(outer) and

View File

@@ -0,0 +1 @@
Likely Bugs/Serialization/NonSerializableInnerClass.ql

View File

@@ -0,0 +1,11 @@
import java.io.Serializable
class A {
class X : Serializable {
}
}
class B {
inner class X : Serializable {
}
}