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.
Product Version: NetBeans IDE Dev (Build 201505020001) Java: 1.8.0_45; Java HotSpot(TM) 64-Bit Server VM 25.45-b02 Runtime: Java(TM) SE Runtime Environment 1.8.0_45-b14 System: Windows 7 version 6.1 running on amd64; UTF-8; pl_PL (nb) The following code leads to the "Confusing indentation" warning. I applied code format using the default formatting style. Testcase: public void demo(int check, boolean a, boolean b) { switch (check) { case 1: if (a) { if (b) { System.out.println("a AND b"); } else { System.out.println("a AND NOT b"); } } else // a is false if (b) { System.out.println("NOT a AND b"); } else { System.out.println("NOT a AND NOT b"); } break; // <-- warning case 2: System.out.println("Don't case"); break; default: throw new IllegalArgumentException(check + " is not allowed"); } } Note the warning disappears after removing the "a is false" comment and reformatting code. The strange formatting and comment location comes from bug 252303.
reproducible
Wrong formatting; the if-elseif is AFAIK not a special case, the if inside else should be indented
Fixed in jet-main. http://hg.netbeans.org/jet-main/rev/4632127cda3e
Integrated into 'main-silver', will be available in build *201509250002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/4632127cda3e User: Dusan Balek <dbalek@netbeans.org> Log: Issue #252305 - Cannot avoid warning about a confusing indentation - fixed.