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 93735 - Inserting a class member removes indentation for comments
Summary: Inserting a class member removes indentation for comments
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Pavel Flaska
URL:
Keywords:
Depends on:
Blocks: 90451
  Show dependency tree
 
Reported: 2007-01-31 21:56 UTC by _ deva
Modified: 2007-03-27 15:20 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Test module to reproduce the bug (10.43 KB, application/x-compressed)
2007-01-31 22:00 UTC, _ deva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ deva 2007-01-31 21:56:30 UTC
Identation is lost for comments when you insert a member as follows

MethodTree m = make.Method(....  );
        
//Insert the class before constructor
ClassTree modifiedClazz = make.insertClassMember(clazz, clazz.getMembers
().indexOf(ctor), m);
workingCopy.rewrite(clazz, modifiedClazz);
Comment 1 _ deva 2007-01-31 22:00:46 UTC
Created attachment 37898 [details]
Test module to reproduce the bug
Comment 2 _ deva 2007-01-31 22:02:03 UTC
Install the attached module, and follow these steps
1) Open the file TestClass.java which is part of the project
2) Select Refactor|Insert Member in the menu

You will notice that the comment preceding the constructor moves to the left
Before insert:
    String s;
    //Insert the members above this comment
After insert:
    String s;
    
    public void foo() {
    }
//Insert the members above this comment
Comment 3 Pavel Flaska 2007-03-27 15:17:51 UTC
This should work correctly now. Please, verify, thanks.
Comment 4 Pavel Flaska 2007-03-27 15:20:20 UTC
Hopefully fixed.