File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
test/query-tests/security/CWE-367/semmle/tests Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,9 @@ predicate alwaysLocked(Field f) {
68
68
or
69
69
exists ( RefType thisType |
70
70
forex ( VarAccess access |
71
- access = f .getAnAccess ( ) and not access .getEnclosingCallable ( ) instanceof InitializerMethod
71
+ access = f .getAnAccess ( ) and
72
+ not access .getEnclosingCallable ( ) instanceof Constructor and
73
+ not access .getEnclosingCallable ( ) instanceof InitializerMethod
72
74
|
73
75
locallySynchronizedOnThis ( access , thisType )
74
76
)
Original file line number Diff line number Diff line change @@ -14,10 +14,10 @@ public FieldAlwaysLocked() {
14
14
protected synchronized void checkOut () {
15
15
Object o ;
16
16
if (field .size () > 0 ) {
17
- Enumeration e = field .keys (); // $ SPURIOUS: Alert
17
+ Enumeration e = field .keys ();
18
18
while (e .hasMoreElements ()) {
19
19
o = e .nextElement ();
20
- field .remove (o ); // $ SPURIOUS: Alert
20
+ field .remove (o );
21
21
}
22
22
}
23
23
}
You can’t perform that action at this time.
0 commit comments