Skip to content

Commit 7d9ce53

Browse files
committed
Kotlin: Exclude .kt files from non serializable field query
1 parent a9023d0 commit 7d9ce53

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

java/ql/src/Likely Bugs/Serialization/NonSerializableField.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ predicate exceptions(Class c, Field f) {
9090

9191
from Class c, Field f, string reason
9292
where
93-
c.fromSource() and
93+
c.getFile().isJavaSourceFile() and
9494
c.getAStrictAncestor() instanceof TypeSerializable and
9595
f.getDeclaringType() = c and
9696
not exceptions(c, f) and
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
| NonSerializableFieldTest.kt:3:22:3:28 | <dispatchReceiver> | This field is in a serializable class, but is not serializable itself because Foo is not serializable. |

0 commit comments

Comments
 (0)