Bug 81945 - [compiler] Enum and Duplicate case error
Summary: [compiler] Enum and Duplicate case error
Status: VERIFIED FIXED
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: 3.1 M5   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 82319 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-12-27 17:53 EST by Bart Geraci CLA
Modified: 2005-02-15 05:41 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bart Geraci CLA 2004-12-27 17:53:08 EST
Using 200412162000

Given the class:
----
public class Test1<X> {
  enum Option { ALPHA, BRAVO  };
  void method1(Option item) {
    switch (item) {
    case ALPHA:      break;
    case BRAVO:      break;
    }
  }
}
----

It compiles without warning using sun's javac.

Eclipse generates an error for the two "case"s in the switch 
 statement with the error "Duplicate case"

If Test1 does NOT have generic arguments, then Eclipse does 
 not complain.

If the Enumerated type Option is moved to a separate file, 
 Eclipse does not complain.
Comment 1 Jerome Lanneluc CLA 2005-01-11 07:12:03 EST
*** Bug 82319 has been marked as a duplicate of this bug. ***
Comment 2 Philipe Mulet CLA 2005-01-11 17:56:01 EST
ParameterizedFieldBinding did not carry proper id.
Added EnumTest#test063.
Comment 3 Philipe Mulet CLA 2005-01-11 17:56:21 EST
Fixed
Comment 4 Jerome Lanneluc CLA 2005-02-15 05:41:56 EST
Verified in I20050214