Skip to content

Commit 96f9a01

Browse files
committed
Correct minor compilation errors in test code
1 parent 84202ff commit 96f9a01

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

java/ql/test/query-tests/Nullness/B.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public void missedGuard(Object obj) {
120120
}
121121

122122
private Object mkMaybe() {
123-
if (maybe) throw new Exception();
123+
if (maybe) throw new RuntimeException();
124124
return new Object();
125125
}
126126

@@ -267,7 +267,7 @@ else if(obj.hashCode() > 7) { // OK
267267
}
268268
if(msg != null) {
269269
msg += "foobar";
270-
throw new Exception(msg);
270+
throw new RuntimeException(msg);
271271
}
272272
obj.hashCode(); // OK
273273
}
@@ -286,7 +286,7 @@ public void loopCorr(int iters) {
286286

287287
int[] b = maybe ? null : new int[iters];
288288
if (iters > 0 && (b == null || b.length < iters)) {
289-
throw new Exception();
289+
throw new RuntimeException();
290290
}
291291
for (int i = 0; i < iters; ++i) {
292292
b[i] = 0; // NPE - false positive

java/ql/test/query-tests/Nullness/C.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public void ex6(int[] vals, boolean b1, boolean b2) {
8787
vals[0] = 0; // OK
8888
break;
8989
default:
90-
throw new Exception();
90+
throw new RuntimeException();
9191
}
9292
}
9393

0 commit comments

Comments
 (0)