You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
java/unsafe-double-checked-locking: not reported when the outer guard is written as !(!(x == null)) #22967
The query reports double-checked locking on a non-volatile field in Dcl.getHelper(). In DclV.getHelper() the outer guard is !(!(helper == null)) instead of helper == null, with the inner check and the field unchanged. Nothing is reported for DclV, though it's the same test.
The java/unsafe-double-checked-locking query matches the standard double-checked locking idiom syntactically, so it only checks for direct == null equality tests rather than evaluating arbitrary boolean expressions such as !(!(x == null)).
Activity
sam-robson commentedon Nov 3, 2026
Hi @MarkLee131, thanks for the detailed report. We'll take a look into this and follow up.
sam-robson commentedon Nov 4, 2026
The
java/unsafe-double-checked-lockingquery matches the standard double-checked locking idiom syntactically, so it only checks for direct== nullequality tests rather than evaluating arbitrary boolean expressions such as!(!(x == null)).