Summary: | enum is a Keyword for Java5 and cannot be used as a Enum name | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Paul Vellan <pvellan> | ||||
Component: | Core | Assignee: | Frederic Fusier <frederic_fusier> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | critical | ||||||
Priority: | P3 | CC: | daniel_megert, Olivier_Thomann | ||||
Version: | 3.2.1 | ||||||
Target Milestone: | 3.3 M4 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Paul Vellan
2006-10-19 14:33:25 EDT
The UI should reject enum as a class name on a 1.5 project. Move to JDT/UI Back to core which says that the name is valid, see JavaConventions.validateJavaTypeName(typeName); (In reply to comment #2) > Back to core which says that the name is valid, see > JavaConventions.validateJavaTypeName(typeName); Hello All, Just to let you know that I used the word 'enum' as a name for an Enumeration in a Java 5 project. I seached the net for 'Java 5 keywords' and every site lists 'enum' as a Java 5 keyword. (In reply to comment #2) > Back to core which says that the name is valid, see > JavaConventions.validateJavaTypeName(typeName); I would say that we should add a new API that would take a source level. enum is an identifier for a project that has a source level < 1.5, but it is a keyword for a project that has a source level >= 1.5. Right now JavaConventions.validateJavaTypeName is using a source level 1.3. This explains why the answer is true for enum. (In reply to comment #4) > I would say that we should add a new API that would take a source level. enum > is an identifier for a project that has a source level < 1.5, but it is a > keyword for a project that has a source level >= 1.5. > Right now JavaConventions.validateJavaTypeName is using a source level 1.3. > This explains why the answer is true for enum. > Agreed. However, we also need to add the source level on all other methods of JavaConventions (except validateClasspath* methods) as they all have the same potential issue. Paul, it would have been nice to put the stack trace in a file and attach it to the bug. It's not really easy to browse comments with such a huge one at the beginning of the description. Created attachment 53291 [details]
Proposed patch
Released for 3.3 M4 in HEAD stream. Verified for 3.3M4 with I20061212-0010. |