We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0c37ea8 commit 6f11849Copy full SHA for 6f11849
java/ql/test/query-tests/UselessComparisonTest/B.java
@@ -0,0 +1,22 @@
1
+import java.util.*;
2
+import java.util.function.*;
3
+
4
+public class B {
5
+ int modcount = 0;
6
7
+ int[] arr;
8
9
+ public void modify(IntUnaryOperator func) {
10
+ int mc = modcount;
11
+ for (int i = 0; i < arr.length; i++) {
12
+ arr[i] = func.applyAsInt(arr[i]);
13
+ }
14
+ // Always false unless there is a call path from func.applyAsInt(..) to
15
+ // this method, but should not be reported, as checks guarding
16
+ // ConcurrentModificationExceptions are expected to always be false in the
17
+ // absence of API misuse.
18
+ if (mc != modcount)
19
+ throw new ConcurrentModificationException();
20
+ modcount++;
21
22
+}
0 commit comments