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 7.4 (Build 201310111528) Operating System = Linux version 3.2.0-57-generic running on amd64 Java; VM; Vendor = 1.7.0_45 Runtime = Java HotSpot(TM) 64-Bit Server VM 24.45-b08 "Introduce Constant" places the new constant immediately following the method from which it was extracted. 7.3 placed it at the top of the class. If it is supposed to follow the ordereing set in Tools -> Options -> Editor -> Formatting -> Java -> Ordering that is not working, as "Static Fields" is the first thing in that list for me. Example - Before Refactoring private void createModelServers() { modelServers = new JSONListTableModel(); modelServers.addColumn("hostname", "Server", 0.10, String.class); modelServers.addColumn("rolename", "Role", 0.10, String.class); tableServers.setColumnsVersion(3); tableServers.setModel(modelServers); } After Refactoring private void createModelServers() { modelServers = new JSONListTableModel(); modelServers.addColumn("hostname", "Server", 0.10, String.class); modelServers.addColumn(COL_ROLENAME, "Role", 0.10, String.class); tableServers.setColumnsVersion(3); tableServers.setModel(modelServers); } private static final String COL_ROLENAME = "rolename";
Also appears to be broken for "Introduce field"
The "Insertion Point" setting at Tools -> Options -> Editor -> Formatting -> Java -> Ordering also appears to have no effect on the placement of the new constant.
Please configure the 'Insertion point' in Tools | Options - Formatting/Java category "Ordering". It is set to 'insertion point' by default, which causes the introduced field/constant to be generated after the selected range (after the enclosing method). Set it to first/last in category to make the code generator to obey code ordering rules.
As noted above, the setting of "Insertion Point" appears to be ignored in both 7.4 and 8.0 Beta. In 8.0 Beta, when I change the Insertion Point to "First in Category" then click "Apply", it changes back to "Last in Category". Same when using the "OK" button. "Caret Location" seems to stick as it should, but this is not the seting I want. Same behvaior observed in 7.4.
This appears to be fixed in 8.0. The options dialog is holding the "Caret location" value and the refactoring honors that setting.