mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
Adapt inner-class-could-be-static query now that specialised methods are callable via an implicit this qualifier.
Previously such a call always targeted the unbound method, so we checked for an inherited method that could be a specialisation thereof; now we expect it should be directly inherited.
This commit is contained in:
@@ -78,7 +78,7 @@ RefType enclosingInstanceAccess(Expr expr) {
|
||||
result = ma.getMethod().getDeclaringType() and
|
||||
not exists(ma.getQualifier()) and
|
||||
not ma.getMethod().isStatic() and
|
||||
not exists(Method m | m.getSourceDeclaration() = ma.getMethod() | enclosing.inherits(m))
|
||||
not enclosing.inherits(ma.getMethod())
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user