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 44344 - [gjast] Enumeration containing just constants are mapped incorrectly
Summary: [gjast] Enumeration containing just constants are mapped incorrectly
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 4.x
Hardware: PC Linux
: P1 blocker (vote)
Assignee: _ tball
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-04 13:21 UTC by Martin Matula
Modified: 2007-04-03 18:02 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Test file. (151 bytes, text/plain)
2004-06-04 13:21 UTC, Martin Matula
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Matula 2004-06-04 13:21:09 UTC
Simple enumerations like: 

public enum MyEnum {A, B}

return "B}" in ENUM_BODY_DECLARATIONS subtree,
which should be null instead. Other parts of the
tree seem ok. Attached is a simple enum as a test
case.
Comment 1 Martin Matula 2004-06-04 13:21:53 UTC
Created attachment 15476 [details]
Test file.
Comment 2 _ tball 2004-06-04 18:17:42 UTC
An NPE is indeed bad, and easy to fix.  I need to know what an empty
enum body should be defined as, however.  An empty body, as spec'd,
requires beginning and end token positions (all trees do), but it
doesn't have any tokens and so should probably be null.  Please clarify.
Comment 3 _ tball 2004-06-04 18:23:21 UTC
Please ignore the NPE comment from above.  Both this bug and 44346 has
related questions regarding the spec, and I confused which window I
had open when responding to this one.
Comment 4 Martin Matula 2004-06-04 18:58:28 UTC
In this case the ENUM_BODY should contain a non empty ENUM_CONSTATNS
subtree (exactly like it does currently) and the second subtree (at
index 1) should be null. I will check it again, but I believe this
worked in some of the previous versions of gjast so this seems to be a
regression.
Comment 5 _ tball 2004-06-04 21:52:28 UTC
Fixed mapping.
Comment 6 Martin Matula 2004-06-04 22:30:27 UTC
Verified.