langtools/test/tools/javac/enum/EnumSwitch2.java
author sadayapalam
Thu, 12 Mar 2015 10:24:07 +0530
changeset 29430 0fc887a8c519
parent 25309 dcd9a7e19669
permissions -rw-r--r--
8050021: Improper "duplicate case label" error Reviewed-by: jlahoda

/*
 * @test /nodynamiccopyright/
 * @bug 4936393 8050021
 * @summary enum switch case labels required to be unqualified.
 * @author gafter
 * @compile/fail/ref=EnumSwitch2.out -XDrawDiagnostics EnumSwitch2.java
 */

enum E1 { a, b, c, d, e }

class EnumSwitch2 {
    void f(E1 e1) {
        switch (e1) {
        case E1.a:
        case E1.d:
        default:
            break;
        }
    }
}