langtools/test/tools/javac/6304921/T6304921.java
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 10 06bc494ca11e
child 323 ba0845d0b4dc
permissions -rw-r--r--
Initial load
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
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 * @ignore
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 *    Need to fix this test post whitespace normalization
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * @compile/fail/ref=T6304921.out -XDstdout -XDcompilePolicy=bytodo -XDdiags=%b:%s/%o/%e:%_%t%m|%p%m -Xjcov -Xlint:all,-path -Werror T6304921.java
06bc494ca11e Initial load
duke
parents:
diff changeset
     7
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
import java.util.ArrayList;
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
import java.util.List;
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
class T6304921 {
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
    void m1(int i) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
        switch (i) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
        case 1:
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
            i++;
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
            // fallthrough
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
        default:
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
06bc494ca11e Initial load
duke
parents:
diff changeset
    21
        try {
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
            i++;
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
        finally {
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
            throw new Error();
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
            // finally does not complete normally
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
    void m2() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
        List<Integer> list = new ArrayList();
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
class X {
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
    void m1() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
        System.orr.println("abc"); // name not found
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
    boolean m2() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
        return 123 + true; // bad binary expression
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
}