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

Summary: Inserting a class member removes indentation for comments
Product: java Reporter: _ deva <deva>
Component: SourceAssignee: Pavel Flaska <pflaska>
Status: RESOLVED FIXED    
Severity: blocker CC: sandipchitale
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 90451    
Attachments: Test module to reproduce the 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.