Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 78394 - enum case statements do not resolve enum values
Summary: enum case statements do not resolve enum values
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 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-11 10:53 EST by Mark Helmstetter CLA
Modified: 2004-11-11 11:01 EST (History)
0 users

See Also:


Attachments
PlayerColorTest (780 bytes, application/octet-stream)
2004-11-11 10:55 EST, Mark Helmstetter CLA
no flags Details
PlayerColor enum class (310 bytes, application/octet-stream)
2004-11-11 10:56 EST, Mark Helmstetter CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Helmstetter CLA 2004-11-11 10:53:40 EST
Using Eclipse 3.1M3 (Build id: 200411050810)

enum case statments do not compile.  For example the method below results in
compile errors "RED cannot be resolved" and "BLUE cannot be resolved".  This
code compiles fine using javac 1.5.0.

    public int getPlayerId(PlayerColor playerColor) {
        switch(playerColor) {
            case RED:
                return 1;
            case BLUE:
                return 2;
            default:
                return 0;
        }
    }
Comment 1 Mark Helmstetter CLA 2004-11-11 10:55:54 EST
Created attachment 15797 [details]
PlayerColorTest
Comment 2 Mark Helmstetter CLA 2004-11-11 10:56:32 EST
Created attachment 15798 [details]
PlayerColor enum class
Comment 3 Frederic Fusier CLA 2004-11-11 11:01:07 EST

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