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 170373 - Errorous generation of enum fields
Summary: Errorous generation of enum fields
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Max Sauer
Depends on:
Reported: 2009-08-14 13:26 UTC by Max Sauer
Modified: 2009-08-21 06:09 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:

Proposed API change (3.81 KB, patch)
2009-08-14 13:42 UTC, Max Sauer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Max Sauer 2009-08-14 13:26:46 UTC

enum TestEnum {
  A, B

and invoking 'Add default serialVersionUID' hint produces code with error -- missing semicolon, which leads to uncompilable code.
Comment 1 Max Sauer 2009-08-14 13:41:30 UTC
I would like to propose a small change in java.source API.

For this issue and possibly also elsewhere, it would be nice to introduce a new method in to be able to recognize 
an Enum constant from tree. Similar methods are already present.

Method signature:
public boolean isEnumConstant(VariableTree tree)

I'll attach diff.
Comment 2 Max Sauer 2009-08-14 13:42:30 UTC
Created attachment 86241 [details]
Proposed API change
Comment 3 Dusan Balek 2009-08-14 14:01:57 UTC
Strange description in apichanges.xml:
"Added <code>TreeUtilities.isEnumConstant()</code> to return the TreeUtilities."

Otherwise it seems OK to me.
Comment 4 Max Sauer 2009-08-17 10:01:27 UTC
API Change:

Fix of issue with enum:
Comment 5 Quality Engineering 2009-08-21 06:09:09 UTC
Integrated into 'main-golden', will be available in build *200908210201* on (upload may still be in progress)
User: Max Sauer <>
Log: #170373: Adding TreeUtilities.isEnumConstant()