File: T4717164.java

package info (click to toggle)
libnb-javaparser-java 9%2B2018-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 65,172 kB
  • sloc: java: 440,096; xml: 6,359; sh: 865; makefile: 314
file content (23 lines) | stat: -rw-r--r-- 648 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
 * @test /nodynamiccopyright/
 * @bug 4717164
 * @summary missing catch not reachable error when nested try-finally returns in finally
 * @author Neal Gafter (gafter)
 *
 * @compile/fail/ref=T4717164.out -XDrawDiagnostics  T4717164.java
 */

class T4717164 {
    public static void main(String[] args) {
        try {
            try {
                throw new ClassNotFoundException();
            } catch (ClassNotFoundException e) {
                throw e;
            } finally {
                return; // discards ClassNotFoundException
            }
        } catch (ClassNotFoundException e1) { // error: unreachable
        }
    }
}