1 // Check that a NPE likely thrown from the first instruction of a
2 // method (foo) is properly caught.
5 public static void main(String
[] args
)
7 Throw_3 al
= new Throw_3();
12 catch (NullPointerException npe
)
14 StackTraceElement ste
[] = npe
.getStackTrace();
15 StackTraceElement top
= ste
[0];
16 if ("foo".equals(top
.getMethodName()))
18 System
.out
.println("ok");
22 System
.out
.println("bad");
25 public int bar(int[] a
)
27 System
.out
.println("Bar");
32 * If the second parameter ('this' being the first) is passed in a
33 * register, then the first machine instruction in foo is likely to
34 * fault when null is passed.
36 public int foo(int[] a
)