Skip to content

Commit 35552a8

Browse files
committed
Java: restrict java/non-sync-override to immediate overrides
1 parent ff5a98b commit 35552a8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

java/ql/src/Likely Bugs/Concurrency/NonSynchronizedOverride.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ where
5656
sup.isSynchronized() and
5757
not sub.isSynchronized() and
5858
not delegatingOverride(sub, sup) and
59+
not exists(Method mid | sub.overrides(mid) and mid.overrides(sup)) and
5960
supSrc = sup.getDeclaringType().getSourceDeclaration()
6061
select sub,
6162
"Method '" + sub.getName() + "' overrides a synchronized method in $@ but is not synchronized.",

0 commit comments

Comments
 (0)