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.
"Create field" hint creates desired field in between of class constructor and its javadoc comment. See attached screenshot. Steps to reproduce: ------------------- 1) Create a new j2se project 2) Open Main.java 3) Between Constructor and main() method, add: public void foo() { sb = new StringBuffer(); } 4) Invoke appeared hint => Field created in an inappropriate place --- NetBeans IDE Dev (Build 061005) 1.6.0-rc; Java HotSpot(TM) Client VM 1.6.0-rc-b99 SunOS version 5.10 running on sparc en (nb); ISO646-US
Created attachment 34916 [details] screenshot
The feature position is correct (meant that is the first member in class), but is between constructor javadoc and definition. It is generator issue.
*** Issue 86489 has been marked as a duplicate of this issue. ***
Basic case fixed. More commits to come. Checking in src/org/netbeans/modules/java/save/PositionEstimator.java; /cvs/java/source/src/org/netbeans/modules/java/save/Attic/PositionEstimator.java,v <-- PositionEstimator.java new revision: 1.1.2.9; previous revision: 1.1.2.8 done Checking in src/org/netbeans/modules/java/save/TreeDiff.java; /cvs/java/source/src/org/netbeans/modules/java/save/Attic/TreeDiff.java,v <-- TreeDiff.java new revision: 1.1.2.17; previous revision: 1.1.2.16 done Checking in test/cfg-unit.xml; /cvs/java/source/test/Attic/cfg-unit.xml,v <-- cfg-unit.xml new revision: 1.1.2.6; previous revision: 1.1.2.5 done RCS file: /cvs/java/source/test/unit/src/org/netbeans/api/java/source/gen/Attic/FeatureAddingTest.java,v done Checking in test/unit/src/org/netbeans/api/java/source/gen/FeatureAddingTest.java; /cvs/java/source/test/unit/src/org/netbeans/api/java/source/gen/Attic/FeatureAddingTest.java,v <-- FeatureAddingTest.java new revision: 1.1.2.1; previous revision: 1.1 done
This is no longer reproducible because of many changes... Currently, it is testable only with test (or patched hint), it is not possible to use hint. (Current hint adds the created field at the end of the class.) Hints has to be fixed.
Marking as VERIFIED, since the original case is no longer reproducible. --- NetBeans IDE Dev (Build 070425) 1.6.0_01; Java HotSpot(TM) Server VM 1.6.0_01-b04 Linux version 2.6.12-1.1390_FC4smp running on i386 en_US (nb); UTF-8