diff --git a/java/ql/lib/semmle/code/java/dispatch/VirtualDispatch.qll b/java/ql/lib/semmle/code/java/dispatch/VirtualDispatch.qll index 56385e89877..eb1878bf7e4 100644 --- a/java/ql/lib/semmle/code/java/dispatch/VirtualDispatch.qll +++ b/java/ql/lib/semmle/code/java/dispatch/VirtualDispatch.qll @@ -99,10 +99,12 @@ private module Dispatch { private predicate lowConfidenceDispatchType(SrcRefType t) { t instanceof TypeObject or - t instanceof FunctionalInterface + t instanceof Interface and not t.fromSource() or t.hasQualifiedName("java.io", "Serializable") or + t.hasQualifiedName("java.lang", "Iterable") + or t.hasQualifiedName("java.lang", "Cloneable") or t.getPackage().hasName("java.util") and t instanceof Interface