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.

Bug 112361 - Reformat code deletes comments.
Summary: Reformat code deletes comments.
Status: RESOLVED DUPLICATE of bug 114024
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 6.x
Hardware: All Windows Vista
: P3 blocker (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-08 21:57 UTC by infortel
Modified: 2007-09-26 09:14 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description infortel 2007-08-08 21:57:11 UTC
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;
    }
}
=====================================================================
Comment 1 Jiri Prox 2007-08-09 08:56:31 UTC
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
Comment 2 kcr 2007-08-23 18:52:04 UTC
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.
Comment 3 Petr Hrebejk 2007-09-01 12:51:11 UTC

*** This issue has been marked as a duplicate of 114024 ***