author | mcimadamore |
Wed, 26 Oct 2016 15:41:25 +0100 | |
changeset 41856 | 13a056e8f16e |
parent 26528 | a1a7ad15183e |
permissions | -rw-r--r-- |
10 | 1 |
/* |
26528
a1a7ad15183e
8055075: Group 9b: golden files for tests in tools/javac dir
sogoel
parents:
5520
diff
changeset
|
2 |
* @test /nodynamiccopyright/ |
10 | 3 |
* @bug 4630634 |
4 |
* @summary missing warn about exception not thrown in try block if finally can't complete |
|
5 |
* @author gafter |
|
6 |
* |
|
26528
a1a7ad15183e
8055075: Group 9b: golden files for tests in tools/javac dir
sogoel
parents:
5520
diff
changeset
|
7 |
* @compile/fail/ref=ExceptionalFinally2.out -XDrawDiagnostics ExceptionalFinally2.java |
10 | 8 |
*/ |
9 |
||
10 |
class ExceptionalFinally2 { |
|
11 |
static class E extends Exception {} |
|
12 |
||
13 |
public void t() throws E {} |
|
14 |
||
15 |
void f() { |
|
16 |
try { |
|
17 |
try { |
|
18 |
t(); |
|
19 |
} finally { |
|
20 |
return; |
|
21 |
} |
|
22 |
} catch (E x) { // error: E can't be thrown in try block |
|
23 |
} |
|
24 |
} |
|
25 |
} |