langtools/test/tools/javac/multicatch/Pos06.java
author mcimadamore
Thu, 04 Nov 2010 12:57:48 +0000
changeset 7203 1153590927f7
permissions -rw-r--r--
6993963: Project Coin: Use precise exception analysis for effectively final catch parameters Summary: More precise rethrow analysis should be extended to effectively-final exception parameters. Multicatch parameters should be made implicitly final. Reviewed-by: jjg, darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7203
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
     1
/*
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
     2
 * @test /nodynamiccopyright/
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
     3
 * @bug 6993963
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
     4
 *
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
     5
 * @summary Project Coin: Use precise exception analysis for effectively final catch parameters
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
     6
 * @author mcimadamore
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
     7
 * @compile Pos06.java
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
     8
 *
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
     9
 */
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
    10
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
    11
class Pos06 {
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
    12
    static class A extends Exception {}
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
    13
    static class B extends Exception {}
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
    14
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
    15
    void m() {
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
    16
        try {
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
    17
            if (true) {
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
    18
                throw new A();
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
    19
            }
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
    20
            else {
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
    21
                throw new B();
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
    22
            }
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
    23
        } catch (A | B ex) {
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
    24
            System.out.println(ex);
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
    25
        }
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
    26
    }
1153590927f7 6993963: Project Coin: Use precise exception analysis for effectively final catch parameters
mcimadamore
parents:
diff changeset
    27
}