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.

Bug 121443 - Enumeration literal
Summary: Enumeration literal
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: Macintosh Mac OS X
: P4 blocker (vote)
Assignee: Svata Dedic
Keywords: API
Depends on:
Reported: 2007-11-08 10:25 UTC by egiva
Modified: 2013-09-02 14:22 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description egiva 2007-11-08 10:25:36 UTC
There are no method in TreeMaker to create enumeration literal
Comment 1 Jan Becicka 2008-02-01 09:40:01 UTC
Enumeration literal?
There is not any enumeration literal in JLS. Use make.Identifier.
Comment 2 egiva 2008-02-01 11:28:11 UTC
I mean we have let say:
enum Color

How could I create enumeration members BLACK, WHITE? Do you really mean by Identifier? But it must be a "VariableTree",
is n't it?
Comment 3 Jan Becicka 2008-02-01 12:18:07 UTC
I thought, that you want to use enum constant like this setColor(Color.WHITE)

So make.Variable does not work for you?

Comment 4 egiva 2008-02-01 12:31:35 UTC
It doesn't distinct from simple field (variable creates only field). Suppose we have BLACK as literal, but WHITE as field

enum Color
public static final Color WHITE;
Comment 5 Jan Becicka 2008-02-01 15:33:44 UTC
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.
Comment 6 egiva 2008-02-01 15:54:50 UTC
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) :)
Comment 7 Jiri Prox 2008-04-11 00:53:06 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 8 Rastislav Komara 2009-02-03 10:55:36 UTC
Comment 9 Jan Lahoda 2009-08-20 09:59:45 UTC
Reassigning all moonko's java/source bugs to myself.
Comment 10 David Strupl 2012-10-25 13:41:46 UTC
Bug prior to 7.0, not touched for the last 2 years --> P4.