Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 79169 - enum switch requires static import
Summary: enum switch requires static import
Status: RESOLVED DUPLICATE of bug 77430
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-22 07:03 EST by David Gates CLA
Modified: 2004-11-22 09:55 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Gates CLA 2004-11-22 07:03:37 EST
This problem muddies namespaces.

--example--
//MyEnum.java
package bugdemo;
public enum MyEnum {
	VALUEA, VALUEB, VALUEC
}

//BugDemo.java
package bugdemo;
public class BugDemo {
	public void bugDemo(MyEnum parameter) {
		switch(parameter) {
			//causes error: "Cannot qualify the name of the enum constant VALUEA in a
case label"
			case MyEnum.VALUEA :
		}
	}
}

//BugDemo2.java
package bugdemo
import static bugdemo.MyEnum.VALUEA;
public class BugDemo2 {
	public void bugDemo(MyEnum parameter) {
		switch(parameter) {
			//works
			case VALUEA :
		}
	}
}
Comment 1 David Gates CLA 2004-11-22 07:04:10 EST
Found on Eclipse 3.1M3
Comment 2 Olivier Thomann CLA 2004-11-22 09:55:48 EST

*** This bug has been marked as a duplicate of 77430 ***