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.
Created attachment 141907 [details] error 1. Create new simple java class: package test; public class Test { public void m(){ m1(3, 4, 5); System.out.println(m1(3, 4, 5)); } public boolean m1(int a, int b, int c){ if (a * a + b * b == c * c) { return true; } return false; } } 2. put caret into "System.out.println(m|1(3, 4, 5));" where '|' is a position of carat 3. From main menu select Refactor > Invert Boolean... and confirm dialog >> It creates incompilable code: >> ... >> public void m(){ >> !m1(3, 4, 5); // error >> System.out.println(!m1(3, 4, 5)); >> } >> ... 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: 0638bcca5827 user: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org> date: Mon Oct 20 16:09:37 2014 +0200 summary: #238057 - [Invert Boolean] Makes incompilable code if result is not accessed to variable
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/0638bcca5827 User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org> Log: #238057 - [Invert Boolean] Makes incompilable code if result is not accessed to variable
Unfortunately the issue is still reporducible on the code provided by Standa. Product Version: NetBeans IDE Dev (Build 201411030002) 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