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 6.8 Beta (Build 200909281634) Java: 1.6.0_16; Java HotSpot(TM) Client VM 14.2-b01 System: Linux version 2.6.24-23-generic running on i386; UTF-8; en_US (nb) The indentation is wrong when hint is applied in switch statement. Steps to reproduce: 0) keep default formatting setting 1) have a code: public void test() { int x = 2; switch (x) { case 1: System.getProperties(); } } 2) apply hint "assign return value to new variable" -> public void test() { int x = 2; switch (x) { case 1: Properties properties = System.getProperties(); } }
Product Version: NetBeans IDE Dev (Build 201504210001) 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 issue is still valid for 8.0.2 version! My test case: public class EnumCodeCompletion { public enum Sample { ONE, TWO, THREE } void demo(Sample number) { switch (number) { case ONE: System.out.println("One"); number.name(); break; case TWO: System.out.println("Two"); break; } } } Invoke hint "Assign Return Value To New Variable" on the line "number.name();" and you will get: void demo(Sample number) { switch (number) { case ONE: System.out.println("One"); String name = number.name(); break; case TWO: System.out.println("Two"); break; } }
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