We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c72437 commit 9fc0793Copy full SHA for 9fc0793
java/ql/test/query-tests/Nullness/B.java
@@ -496,4 +496,23 @@ public void initCorr(boolean b) {
496
else
497
o2.hashCode(); // OK
498
}
499
+
500
+ public void complexLoopTest(int[] xs, int[] ys) {
501
+ int len = ys != null ? ys.length : 0;
502
+ for (int i = 0, j = 0; i < xs.length; i++) {
503
+ if (j < len && ys[j] == 42) { // OK
504
+ j++;
505
+ } else if (j > 0) {
506
+ ys[0]++; // OK
507
+ }
508
509
510
511
+ public void trackTest(Object o, int n) {
512
+ boolean isnull = o == null;
513
+ int c = -1;
514
+ if (maybe) { }
515
+ if (c == 100) { return; }
516
+ o.hashCode(); // NPE - false negative
517
518
0 commit comments