1 /*
2 * @test /nodynamiccopyright/
3 * @bug 6558548 7039937
4 * @summary The compiler needs to be aligned with clarified specification of throws
5 * @compile/fail/ref=T6558548_latest.out -XDrawDiagnostics T6558548.java
6 * @compile/fail/ref=T6558548_6.out -source 6 -Xlint:-options -XDrawDiagnostics T6558548.java
7 */
8
9 class T6558548 {
10
11 void nothing() {}
12 void checked() throws InterruptedException {}
13 void runtime() throws IllegalArgumentException {}
14
15 void m1a() {
16 try {
17 throw new java.io.FileNotFoundException();
18 }
19 catch(java.io.FileNotFoundException exc) { }
20 catch(java.io.IOException exc) { } // 6: ok; latest: unreachable
21 }
22
23 void m1b() {
24 try {
25 throw new java.io.IOException();
26 }
|
1 /*
2 * @test /nodynamiccopyright/
3 * @bug 6558548 7039937
4 * @summary The compiler needs to be aligned with clarified specification of throws
5 * @compile/fail/ref=T6558548_latest.out -XDrawDiagnostics T6558548.java
6 */
7
8 class T6558548 {
9
10 void nothing() {}
11 void checked() throws InterruptedException {}
12 void runtime() throws IllegalArgumentException {}
13
14 void m1a() {
15 try {
16 throw new java.io.FileNotFoundException();
17 }
18 catch(java.io.FileNotFoundException exc) { }
19 catch(java.io.IOException exc) { } // 6: ok; latest: unreachable
20 }
21
22 void m1b() {
23 try {
24 throw new java.io.IOException();
25 }
|