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. Assume following java class (note, that output of code is 4): package simpleapplication123; public class SimpleApplication123 { public static void main(String[] args) { myMethod(); } static void myMethod(){ int a = 5; if(--a > 0){ System.out.println(a); } } } 2. Select "--a > 0" statement and using Alt+Shift+M invoke "Introduce Method" refactor dialog 3. Enter name "m" and press Ok. 4. You'll get following code: package simpleapplication123; public class SimpleApplication123 { public static void main(String[] args) { myMethod(); } static void myMethod(){ int a = 5; if(m(a)){ System.out.println(a); } } private static boolean m(int a) { return --a > 0; } } >> now the output of code is 5 (see attached images) Product Version: NetBeans IDE 7.3.1 (Build 201306052037) Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b56 Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b43 System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Created attachment 139737 [details] before
Created attachment 139738 [details] after
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