21 * questions. |
21 * questions. |
22 */ |
22 */ |
23 |
23 |
24 // key: compiler.warn.unreachable.catch.1 |
24 // key: compiler.warn.unreachable.catch.1 |
25 |
25 |
|
26 import java.io.*; |
|
27 |
26 class UnreachableCatch1 { |
28 class UnreachableCatch1 { |
27 |
29 |
28 void test() { |
30 void test() { |
29 try { |
31 try { |
30 throw new IllegalArgumentException(); |
32 if (true) { |
|
33 throw new FileNotFoundException(); |
|
34 } |
|
35 else { |
|
36 throw new EOFException(); |
|
37 } |
31 } |
38 } |
32 catch(Error err) { } |
39 catch(FileNotFoundException fnf) { } |
33 catch(RuntimeException rex) { } |
40 catch(EOFException eof) { } |
34 catch(Throwable t) { } //unreachable |
41 catch(IOException ex) { } //unreachable |
35 } |
42 } |
36 } |
43 } |