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 134655 - [Encapsulate fields] Javadoc inserted at wrong position when encapsulating package private field
Summary: [Encapsulate fields] Javadoc inserted at wrong position when encapsulating pa...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Rastislav Komara
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2008-05-07 11:30 UTC by Jiri Prox
Modified: 2009-07-03 17:38 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 Jiri Prox 2008-05-07 11:30:58 UTC
Product Version: NetBeans IDE Dev (Build 20080506010347)
Java: 1.6.0_10-beta; Java HotSpot(TM) Client VM 11.0-b11
System: Linux version 2.6.22-14-generic running on i386; UTF-8; en_US (nb)

Javadoc duplicated and inserted at wrong position when encapsulating package private filed.

Steps to reproduce:
1) have a class
public class NewClass {

    /**
     * javadoc
     */
    int x;
    
}

2) encapsulate x
->
public class NewClass {

    /**
     * javadoc
     */
    private int x;

    public

    /**
     * javadoc
     */
    int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }
    
    
}
Comment 1 Jan Pokorsky 2008-05-15 16:43:28 UTC
It is a source generator bug. The refactoring simply uses

MethodTree getter = make.Method(...);
Comment comment = Comment.create(Comment.Style.JAVADOC, -2, -2, -2, javadocText);
make.addComment(getter, comment, true);

BTW for me javadoc of the setter is generated properly unlike javadoc of the getter.

Reassigning to java/source.
Comment 2 Rastislav Komara 2009-02-03 10:52:13 UTC
Overtake.
Comment 3 Rastislav Komara 2009-06-30 14:21:02 UTC
Adding RANDOM keyword. I can reproduce this issue only in several cases using the same input.
Comment 4 Rastislav Komara 2009-07-01 13:47:30 UTC
fixed.
Comment 5 Quality Engineering 2009-07-03 17:38:22 UTC
Integrated into 'main-golden', will be available in build *200907031400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/e00b026b485e
User: Rastislav Komara <moonko@netbeans.org>
Log: Issue #134655:[Encapsulate fields] Javadoc inserted at wrong position when encapsulating package private field