Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 545516

Summary: [12] multi-constant case expression - preview feature warning not flagged
Product: [Eclipse Project] JDT Reporter: Manoj N Palat <manoj.palat>
Component: CoreAssignee: 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:

Description Manoj N Palat CLA 2019-03-19 01:23:37 EDT
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.
Comment 1 Jay Arthanareeswaran CLA 2019-03-19 02:57:53 EDT
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 ***