Java: restrict java/non-sync-override to immediate overrides

This commit is contained in:
yh-semmle
2019-10-10 19:55:31 -04:00
parent ff5a98b260
commit 35552a8c0e

View File

@@ -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.",