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 144209 - [Inner To Outer] Inner class comments lost
Summary: [Inner To Outer] Inner class comments lost
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jan Pokorsky
: 147309 (view as bug list)
Depends on: 103623
Blocks: 100829
  Show dependency tree
Reported: 2008-08-17 20:05 UTC by err
Modified: 2011-01-22 06:13 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description err 2008-08-17 20:05:49 UTC
In the following, all the inner class comments are lost in refactoring
    - javadoc comments
    - /* ... */ comments
    - // comments
This is particularly onerous since some comments were added so that the refactoring could proceed, see Issue 144208 .

package javaapplication1;

import java.awt.event.ActionEvent;
import java.awt.event.MouseEvent;
import javax.swing.AbstractAction;

public class Outer {

    static void refresh() {

     * javadoc comment for Inner.
    static class Inner {
        void refresh() {

         * javadoc for Inner.handler
         * @param e
        void handler(MouseEvent e) {
            new InnerInner();

        private void someInnerMethod() {
            // test comment
            System.err.println("in inner method");

         * javadoc comment for InnerInner
        private class InnerInner extends AbstractAction {

            /* coment with '*' */

            public void actionPerformed(ActionEvent e) {



Product Version: NetBeans IDE 6.5 Beta (Build 200808111757)
Java: 1.6.0_07; Java HotSpot(TM) Client VM 10.0-b23
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\erra\.netbeans\6.5beta
Comment 1 Jiri Prox 2008-08-19 12:59:23 UTC
This is serious bug -> P2
Comment 2 Jan Pokorsky 2008-08-19 15:40:05 UTC
I will take a look what's wrong.
Comment 3 Jan Pokorsky 2008-08-21 12:57:19 UTC
The refactoring uses GeneratorUtilities.importComments() (issue 100829) that seems to work properly. In debugger, I
found that Trees that are copied to a new compilation unit has another identity thus the comment mapping fails in
VeryPretty. I am trying to fix this in java/source module. Reassigning to java.

BTW it seems to never work even in NB 6.1.
Comment 4 Jan Pokorsky 2008-08-21 18:22:27 UTC
fixed as

The issue of lost standalone comments (e.g. //Outer.refresh();) still remains. It is tracked as issue 103623.
Comment 5 Quality Engineering 2008-08-22 06:01:30 UTC
Integrated into 'main-golden', available in build *200808220201* on
User: Jan Pokorsky <>
Log: #144209: fixing lost comments of copied Trees
Comment 6 Jan Pokorsky 2008-09-16 15:32:27 UTC
*** Issue 147309 has been marked as a duplicate of this issue. ***
Comment 7 Quality Engineering 2011-01-22 06:13:41 UTC
Integrated into 'main-golden', will be available in build *201101220001* on (upload may still be in progress)
User: Jan Lahoda <>
Log: Adding test for #144209.