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 new simple java class: package test; public class ClassA { public void m1(){ m2(1); } public void m2(int i){ if (i > 5) { System.out.println("abcd"); } } } 2. Select "i" in condition "if (i > 5) {...}" and using Alt+Shift+P invoke Introduce Parameter dialog 3. Set it according the attached image and pres Refactor >> Refactor breaks if (see attached image) Product Version: NetBeans IDE Dev (Build 201311120002) 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)
Image is not attached. I tried the supplied steps, but this works for me.
Sorry, I forgot to attache the image. I mannaged to reproduce the bug: select whole condition (i > 5) and using Alt+Shift+P invoke Introduce Parameter dialog, set it according the image and press Refactor >> it generates incompilable code Product Version: NetBeans IDE 7.4 (Build 201310111528) Java: 1.7.0_51; Java HotSpot(TM) 64-Bit Server VM 24.51-b03 Runtime: Java(TM) SE Runtime Environment 1.7.0_51-b13 System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Created attachment 143776 [details] Before / After
changeset: d629864db55d user: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org> date: Mon Oct 20 12:22:17 2014 +0200 summary: #238301 - [Introduce parameter] Breaks code if apply on condition
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/d629864db55d User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org> Log: #238301 - [Introduce parameter] Breaks code if apply on condition
verified
Integrated into 'releases/release801', will be available in build *201411102027* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/b760a7544834 User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org> Log: #238301 - [Introduce parameter] Breaks code if apply on condition