| Summary: | [12] multi-constant case expression - preview feature warning not flagged | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Manoj N Palat <manoj.palat> |
| Component: | Core | Assignee: | Jay Arthanareeswaran <jarthana> |
| Status: | CLOSED DUPLICATE | QA Contact: | Manoj N Palat <manoj.palat> |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 4.11 | ||
| Target Milestone: | BETA J12 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
I intend to take this up along with bug 545518 since they both are about multi constant case statements and can be covered with one testcase. *** This bug has been marked as a duplicate of bug 545518 *** |
public class X { public void foo(int i) { switch (i) { case 0, 1, 2 :System.out.println("Hello"); default : System.out.println("World"); } } public static void main(String[] argv) { new X().foo(2); } } Compile the code above with --enable-preview on. There should be a warning flagged as "You are using a preview language feature that may or may not be supported in a future release" for multi-constant case.