mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Merge pull request #2118 from yh-semmle/java-non-sync-override
Java: restrict `java/non-sync-override` to immediate overrides
This commit is contained in:
@@ -56,6 +56,7 @@ where
|
||||
sup.isSynchronized() and
|
||||
not sub.isSynchronized() and
|
||||
not delegatingOverride(sub, sup) and
|
||||
not exists(Method mid | sub.overrides(mid) and mid.overrides(sup)) and
|
||||
supSrc = sup.getDeclaringType().getSourceDeclaration()
|
||||
select sub,
|
||||
"Method '" + sub.getName() + "' overrides a synchronized method in $@ but is not synchronized.",
|
||||
|
||||
Reference in New Issue
Block a user