-
Notifications
You must be signed in to change notification settings - Fork 162
Closed
Labels
bugSomething isn't workingSomething isn't workingcompilerEclipse Java Compiler (ecj) related issuesEclipse Java Compiler (ecj) related issuesregressionSomething was broken by a previous changeSomething was broken by a previous change
Description
Found by code inspection & white box testing:
The program below when compiled with javac and run produces the output:
E1.ONE
E1.TWO
E2.ONE
E2.TWO
E1.TWO
E2.ONE
E2.TWO
E2.ONE
E2.TWO
E2.TWO
but is rejected by ECJ with three errors of: Duplicate case
public sealed interface X {
public static void main(String[] args) {
bar(E1.ONE);
bar(E1.TWO);
bar(E2.ONE);
bar(E2.TWO);
}
public static void bar(X x) {
switch (x) {
case E1.ONE:
System.out.println("E1.ONE");
case E1.TWO:
System.out.println("E1.TWO");
case E2.ONE:
System.out.println("E2.ONE");
case E2.TWO:
System.out.println("E2.TWO");
}
}
}
enum E1 implements X { ONE, TWO}
enum E2 implements X { ONE, TWO}
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcompilerEclipse Java Compiler (ecj) related issuesEclipse Java Compiler (ecj) related issuesregressionSomething was broken by a previous changeSomething was broken by a previous change