Skip to content

Commit 30e7349

Browse files
Added regression test for throwing NullPointerException
1 parent 60c7c8c commit 30e7349

File tree

5 files changed

+27
-0
lines changed

5 files changed

+27
-0
lines changed
247 Bytes
Binary file not shown.
241 Bytes
Binary file not shown.
Binary file not shown.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
class B extends RuntimeException {}
2+
3+
class A {
4+
int i;
5+
}
6+
7+
public class Test {
8+
public static void main(String args[]) {
9+
A a=null;
10+
try {
11+
int i=a.i;
12+
throw new B();
13+
}
14+
catch (NullPointerException exc) {
15+
assert false;
16+
}
17+
}
18+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
Test.class
3+
--java-throw-runtime-exceptions
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^.*assertion at file Test.java line 15 function.*: FAILURE$
7+
^VERIFICATION FAILED$
8+
--
9+
^warning: ignoring

0 commit comments

Comments
 (0)