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.
1. Create any java project and add following java class: package test; public class Test { public int m(int a, int b){ System.out.println("abc"); System.out.println("abc"); System.out.println("abc"); System.out.println("abc"); int[][] m = new int[][]{{-1, 2, 5}, { 1, -13, 5}}; return b; } public void m2(){ m(5, 6); } } 2. Select first "abc" and using Alt+Shift+P invoke Introduce paraeter dialog 3. Uncheck all checkboxes and select "Create New Method and Delegate from Existing method", then press refactor >> Refactor is performed and reformat method m, so I need to arrange some lines on my own to get original looking: package test; public class Test { public int m(int a, int b){ return m(a, b, "abc"); } public int m(int a, int b, String abc){ System.out.println(abc); System.out.println("abc"); System.out.println("abc"); System.out.println("abc"); int[][] m = new int[][]{{-1, 2, 5}, { 1, -13, 5}}; return b; } public void m2(){ m(5, 6); } } Product Version: NetBeans IDE Dev (Build 201310290001) Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08 Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18 System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
changeset: 217d176aea4a user: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org> date: Mon Oct 20 13:42:55 2014 +0200 summary: #238154 - [Introduce Parameter] Should not reformat original method
Integrated into 'main-silver', will be available in build *201410290913* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/217d176aea4a User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org> Log: #238154 - [Introduce Parameter] Should not reformat original method
unfortunately I can stil reproduce the original issue (the tests pass correctly, but manualy it is still reproducible) Product Version: NetBeans IDE Dev (Build 20141104-d5433ace1b92) Java: 1.8.0_25; Java HotSpot(TM) 64-Bit Server VM 25.25-b02 Runtime: Java(TM) SE Runtime Environment 1.8.0_25-b18 System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb) User directory: C:\Users\jprox\AppData\Roaming\NetBeans\dev Cache directory: C:\Users\jprox\AppData\Local\NetBeans\Cache\dev
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss