Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 348492 - [1.7] Improve error msg on strings in switch in 1.5 mode
Summary: [1.7] Improve error msg on strings in switch in 1.5 mode
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.7.1   Edit
Assignee: Ayushman Jain CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-06 23:40 EDT by Deepak Azad CLA
Modified: 2011-08-05 02:54 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Deepak Azad CLA 2011-06-06 23:40:31 EDT
In the following snippet with 1.5 the compiler does not say anything about using 1.7 level, while javac does. 

- I think this is needed for consistency, as for other 1.7 features the error message informs the user that the feature is available in source level 1.7 or greater.
- In JDT UI we can then provide a quick fix to change compiler compliance to 1.7 (see bug 348459)

-------------------------------------------------------------
    void foo(String s) {
        switch (s) {
        case "abc":
            System.out.println("abcd");
            break;
        case "xyz":
            System.out.println("xyz");
            break;
        }
    }
-------------------------------------------------------------
Comment 1 Deepak Azad CLA 2011-06-07 00:07:02 EDT
See also bug 348493.
Comment 2 Ayushman Jain CLA 2011-06-07 05:31:26 EDT
Fixed in BETA_JAVA7 branch
Comment 3 Srikanth Sankaran CLA 2011-06-28 05:03:54 EDT
Verified using "Eclipse Java Development Tools Patch for Java 7 Support (BETA)	1.0.0.v20110623-0900	org.eclipse.jdt.patch.feature.group	Eclipse.org"