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.
Product Version = NetBeans IDE 8.1 dev (Build 201509100002) Operating System = Windows 7 version 6.1 running on amd64 Java; VM; Vendor = 1.8.0_60 Runtime = Java HotSpot(TM) 64-Bit Server VM 25.60-b23 a class containing code like this [omitted imports, class etc] int myVar; <some other code> Now place the caret / cursor onto myVar and invoke Alt+Inst (insert code) tick myVar and choose create getter/setter NetBeans creates getter and setter methods below myVar and above <some other code> Undo these changes (revert code to get it as listed above) Now place the caret / cursor onto myVar and invoke Alt+Inst (insert code) tick myVar, tick "encapulate fields" and choose create getter/setter NetBeans creates getter and setter methods below <some other code> --> NetBeans should always insert code at the same position, which might correlate to the posistion the user has last choosen on refactor, encapsulate field.
Created attachment 156095 [details] IDE log
Reassigned for further evaluation.
EncapsulateFieldRefactoringPlugin should respect 'CodeStyle.getClassMemberInsertionPoint() == CodeStyle.InsertionPoint.CARET_LOCATION' when inserting getters and setters.
Created attachment 156313 [details] Proposed API change
Created attachment 156314 [details] Proposed Impl
Please review attached API change. Thanks!
Please do not introduce dependency on editor.lib in java.source.base; it would break Tailwind project. Instead of directly using GuardedDocument, please use DocumentGuards API (or extend it as necessary); see for example GeneratorUtilities::insertClassMember
Created attachment 156316 [details] Proposed API change v2 S1 - The added dependency is removed and impl is updated
changeset: 9843a2c01921 user: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org> date: Mon Oct 05 11:16:51 2015 +0200 summary: #255214 - [81cat] Inconsistent behavior od generate getter/setter
Integrated into 'main-silver', will be available in build *201510060002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/9843a2c01921 User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org> Log: #255214 - [81cat] Inconsistent behavior od generate getter/setter