Skip to content

Commit f2897f5

Browse files
authored
Merge pull request #11392 from aschackmull/java/adjust-mad-dispatch-priority
Java: Adjust the prioritisation between MaD and source dispatch.
2 parents 6464135 + 807f87e commit f2897f5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

java/ql/lib/semmle/code/java/dispatch/VirtualDispatch.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,12 @@ private module Dispatch {
9999
private predicate lowConfidenceDispatchType(SrcRefType t) {
100100
t instanceof TypeObject
101101
or
102-
t instanceof FunctionalInterface
102+
t instanceof Interface and not t.fromSource()
103103
or
104104
t.hasQualifiedName("java.io", "Serializable")
105105
or
106+
t.hasQualifiedName("java.lang", "Iterable")
107+
or
106108
t.hasQualifiedName("java.lang", "Cloneable")
107109
or
108110
t.getPackage().hasName("java.util") and t instanceof Interface

0 commit comments

Comments
 (0)