This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Enumeration literal | ||
---|---|---|---|
Product: | java | Reporter: | egiva <egiva> |
Component: | Source | Assignee: | Svata Dedic <sdedic> |
Status: | NEW --- | ||
Severity: | blocker | Keywords: | API |
Priority: | P4 | ||
Version: | 6.x | ||
Hardware: | Macintosh | ||
OS: | Mac OS X | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
egiva
2007-11-08 10:25:36 UTC
Enumeration literal? There is not any enumeration literal in JLS. Use make.Identifier. I mean we have let say: enum Color { BLACK, WHITE; } How could I create enumeration members BLACK, WHITE? Do you really mean by Identifier? But it must be a "VariableTree", is n't it? I thought, that you want to use enum constant like this setColor(Color.WHITE) So make.Variable does not work for you? It doesn't distinct from simple field (variable creates only field). Suppose we have BLACK as literal, but WHITE as field enum Color { BLACK; public static final Color WHITE; } Let's make things clear. 1. Literal is term from lexical analysis. BLACK is not literal, it is identifier, I hope. :) 2. From Elements point of view: BLACK is enum constant, WHITE is field 3. From Trees point of view, there is no difference between enum constant and field. Both are represented by VariableTree. I use literal (more from UML terms), but if you prefer - let it be identifier, or perhaps better use enum constant as it is used in Java. But problem still exist. From Trees, perhaps your implementation doesn't make difference, but when I am updating code for me is important where to put variable - before separator ";" or after. For compiler it is important too (even if it is simple variable in classfile) :) moving opened issues from TM <= 6.1 to TM=Dev Overtake. Reassigning all moonko's java/source bugs to myself. Bug prior to 7.0, not touched for the last 2 years --> P4. |