Correct minor compilation errors in test code

This commit is contained in:
Robin Neatherway
2019-10-25 14:58:52 +01:00
parent 84202ff2e1
commit 96f9a01355
2 changed files with 4 additions and 4 deletions

View File

@@ -120,7 +120,7 @@ public class B {
}
private Object mkMaybe() {
if (maybe) throw new Exception();
if (maybe) throw new RuntimeException();
return new Object();
}
@@ -267,7 +267,7 @@ public class B {
}
if(msg != null) {
msg += "foobar";
throw new Exception(msg);
throw new RuntimeException(msg);
}
obj.hashCode(); // OK
}
@@ -286,7 +286,7 @@ public class B {
int[] b = maybe ? null : new int[iters];
if (iters > 0 && (b == null || b.length < iters)) {
throw new Exception();
throw new RuntimeException();
}
for (int i = 0; i < iters; ++i) {
b[i] = 0; // NPE - false positive

View File

@@ -87,7 +87,7 @@ public class C {
vals[0] = 0; // OK
break;
default:
throw new Exception();
throw new RuntimeException();
}
}