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.
Link: http://services.netbeans.org/synergy/client/app/#/case/4989/suite/1691 Product Version: NetBeans IDE Dev (Build 201507240001) Java: 1.8.0_51; Java HotSpot(TM) 64-Bit Server VM 25.51-b03 Runtime: Java(TM) SE Runtime Environment 1.8.0_51-b16 System: Windows 8 version 6.2 running on amd64; UTF-8; pl_PL (nb) public class JoinConsecutiveIfsIntoIfElse { public void method(boolean cond1, boolean cond2) { if(cond1) { } else { //Hint: Join nested if into the enclosing if if(cond2) { System.out.println("ok"); } else { System.out.println("ko"); } System.out.println(""); } if(cond1) { } else { //NoHint: Join nested if into the enclosing if if(cond2) { System.out.println("ok"); } System.out.println(""); } } } There is no join hint anywhere in the code.
the testcase is IMHO wrong; if(cond1) { } else { //NoHint: Join nested if into the enclosing if if(cond2) { System.out.println("ok"); } System.out.println(""); } cannot be joinec into if (cond1) { ... } else if (cond2) { ...} since System.out should execute if and only if !cond1 (= regardless of cond2)
The first case should be if(cond1) { } else { //Hint: Join nested if into the enclosing if if(cond2) { System.out.println("ok"); } else { System.out.println("ko"); } } Sample file fixed