langtools/test/tools/javac/6304921/T6304921.java
author mikejwre
Wed, 09 Jun 2010 18:56:41 -0700
changeset 5634 895b66935810
parent 2984 e15ff3a34054
child 6150 d055fa8ced62
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
06bc494ca11e Initial load
duke
parents:
diff changeset
     2
 * @test (important: no SCCS keywords to affect offsets in golden file.)  /nodynamiccopyright/
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * @bug 6304921
2984
e15ff3a34054 6722234: javac diagnostics need better integration with the type-system
mcimadamore
parents: 323
diff changeset
     4
 * @compile/fail/ref=T6304921.out -XDstdout -XDcompilePolicy=bytodo -XDrawDiagnostics -Xjcov -Xlint:all,-path -Werror T6304921.java
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
06bc494ca11e Initial load
duke
parents:
diff changeset
     7
import java.util.ArrayList;
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
import java.util.List;
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
class T6304921 {
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
    void m1(int i) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
        switch (i) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
        case 1:
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
            i++;
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
            // fallthrough
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
        default:
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
        try {
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
            i++;
06bc494ca11e Initial load
duke
parents:
diff changeset
    21
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
        finally {
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
            throw new Error();
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
            // finally does not complete normally
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
    void m2() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
        List<Integer> list = new ArrayList();
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
class X {
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
    void m1() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
        System.orr.println("abc"); // name not found
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
    boolean m2() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
        return 123 + true; // bad binary expression
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
}