Better function header dump
[official-gcc.git] / libjava / testsuite / libjava.lang / pr83.java
blobb209aff28b4c9943243128c1544dd70f7b8e6c4a
1 // PR 83
3 /*
4 * test that caught null pointers exceptions in finalizers work correctly
5 * and that local variables are accessible in null pointer exception handlers.
6 */
7 import java.io.*;
9 public class pr83 {
11 static String s;
13 public static void main(String[] args) {
14 System.out.println(tryfinally() + s);
17 public static String tryfinally() {
18 String yuck = null;
19 String local_s = null;
21 try {
22 return "This is ";
23 } finally {
24 try {
25 local_s = "Perfect";
26 /* trigger null pointer exception */
27 String x = yuck.toLowerCase();
28 } catch (Exception _) {
29 /*
30 * when the null pointer exception is caught, we must still
31 * be able to access local_s.
32 * Our return address for the finally clause must also still
33 * be intact.
35 s = local_s;