We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e7dcfc commit e89b42fCopy full SHA for e89b42f
java/ql/lib/semmle/code/java/dispatch/VirtualDispatch.qll
@@ -211,10 +211,14 @@ private module Dispatch {
211
exists(Method m | t.hasMethod(m, _, _) and impl = m.getSourceDeclaration())
212
}
213
214
+ private predicate isAbstractWithSubclass(SrcRefType t) {
215
+ t.isAbstract() and exists(Class c | c.getASourceSupertype() = t)
216
+ }
217
+
218
private predicate hasViableSubtype(RefType t, SrcRefType sub) {
219
sub.extendsOrImplements*(t) and
220
not sub instanceof Interface and
- not sub.isAbstract()
221
+ not isAbstractWithSubclass(sub)
222
223
224
0 commit comments