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.
When I do a REFORMAT CODE some comments are deleted. ==================================================================== The setup is as follows: TOOLS / OPTIONS / JAVACODE has the following changes from the default value: Wrapping: For=Never If=ifLong While=Never Do=Never Blank Lines: Before Class=0 After Class=0 Before Method=0 Alignment and Braces Braces Generation all have been setup as=Eliminate New Lines Else=checked. ============================================================================== code example before REFORMAT CODE: ============================================================================== public class p { public static void test() { int x=1; if (x=2) x=3; else if (x=4) { x=5; } //This comment dissapears when REFORMAT CODE is executed. else if (x=6/*This is digit 6*/) { x=7; } } } ============================================================================== resulting code after REFORMAT CODE: ============================================================================== public class p { public static void test() { int x = 1; if (x = 2) x = 3; else if (x = 4) x = 5; else if (x = 6) x = 7; } } =====================================================================
reproducible Product Version: NetBeans IDE Dev (Build 070809) Java: 1.6.0_03-ea; Java HotSpot(TM) Client VM 1.6.0_03-ea-b01 System: Linux version 2.6.5-1.358 running on i386; UTF-8; en_US (nb) Userdir: /home/jp159440/.netbeans/dev
I just ran into this problem, too. This is a *very* serious bug that makes reformat code too dangerous for me to use. I think it should be a higher priority bug than P3. I hope it will be fixed in the next milestone release.
*** This issue has been marked as a duplicate of 114024 ***