langtools/test/tools/javac/multicatch/7030606/T7030606.java
author katleman
Thu, 21 Aug 2014 14:16:14 -0700
changeset 25878 6d561031123e
parent 9074 76b505d19026
permissions -rw-r--r--
Added tag jdk9-b27 for changeset 98ce0879ab4c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9074
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
     1
/*
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
     2
 * @test /nodynamiccopyright/
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
     3
 * @bug 7030606
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
     4
 *
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
     5
 * @summary Project-coin: multi-catch types should be pairwise disjoint
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
     6
 * @compile/fail/ref=T7030606.out -XDrawDiagnostics T7030606.java
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
     7
 */
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
     8
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
     9
class T7030606 {
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    10
    class E1 extends Exception { }
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    11
    class E2 extends E1 { }
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    12
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    13
    void e1() throws E1 { }
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    14
    void e2() throws E2 { }
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    15
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    16
    void m1() {
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    17
        try {
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    18
            e1();
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    19
            e2();
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    20
        } catch (NonExistentType | E2 | E1 e) { }
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    21
    }
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    22
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    23
    void m2() {
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    24
        try {
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    25
            e1();
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    26
            e2();
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    27
        } catch (NonExistentType | E1 | E2 e) { }
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    28
    }
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    29
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    30
    void m3() {
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    31
        try {
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    32
            e1();
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    33
            e2();
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    34
        } catch (E2 | NonExistentType | E1 e) { }
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    35
    }
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    36
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    37
    void m4() {
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    38
        try {
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    39
            e1();
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    40
            e2();
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    41
        } catch (E1 | NonExistentType | E2 e) { }
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    42
    }
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    43
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    44
    void m5() {
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    45
        try {
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    46
            e1();
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    47
            e2();
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    48
        } catch (E2 | E1 | NonExistentType e) { }
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    49
    }
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    50
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    51
    void m6() {
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    52
        try {
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    53
            e1();
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    54
            e2();
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    55
        } catch (E1 | E2 | NonExistentType  e) { }
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    56
    }
76b505d19026 7030606: Project-coin: multi-catch types should be pairwise disjoint
mcimadamore
parents:
diff changeset
    57
}