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.
Summary: | Pull Up Method To Abstract Super Class Ads Extraneous Comments | ||
---|---|---|---|
Product: | java | Reporter: | MackSix |
Component: | Source | Assignee: | Jan Lahoda <jlahoda> |
Status: | VERIFIED FIXED | ||
Severity: | normal | CC: | jiriprox, mmirilovic |
Priority: | P1 | ||
Version: | 7.3 | ||
Hardware: | PC | ||
OS: | Windows 7 | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | project for reproduction of bug |
Bug still valid in: Product Version: NetBeans IDE 7.3 RC1 (Build 201301172100) Java: 1.7.0_11; Java HotSpot(TM) 64-Bit Server VM 23.6-b04 Runtime: Java(TM) SE Runtime Environment 1.7.0_11-b21 System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb) An unfortunate interaction between disabled assertions and some other changes made into 7.3 long, long, time ago. Will almost surely be reproducible in trunk with disabled assertions. Hotfix: http://hg.netbeans.org/jet-main/rev/cf3650a5a9f8 This fix disabled comment automapping for all trees not belonging into the current source - probably the only realistic fix for 7.3, but long term fix should be: -never disable comment automapping (keep only the warning enabled on assertions, as checking if the tree is part of the current source is slow) -when ImmutableTreeTranslator copies comments from one tree to another, copy also the "comments mapped" status. BTW what to do about GeneratorUtilities.copyComments. This long-term fix currently unfortunately break some refactorings, and is therefore not suitable for 7.3. *** Bug 225108 has been marked as a duplicate of this bug. *** The Extract Interface did the same. I figured it was the same bug. :) The hotfix for 7.3 seems to be OK. Jirka, could you please try to verify? To reproduce in dev builds, please disable assertions (-J-da). Thanks in advance. the fix seems to be ok, verified in trunk Integrated into 'main-golden', will be available in build *201301220001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/cf3650a5a9f8 User: Jan Lahoda <jlahoda@netbeans.org> Log: #225107: hotfix - let TreeUtilities.ensureCommentsMapped not perform the map if the given tree is not from the current compilation unit even if assertions are disabled Integrated into 'releases', will be available in build *201301222100* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/8ab467e3a43e User: Jan Lahoda <jlahoda@netbeans.org> Log: #225107: hotfix - let TreeUtilities.ensureCommentsMapped not perform the map if the given tree is not from the current compilation unit even if assertions are disabled |
Created attachment 130409 [details] project for reproduction of bug 1. Import attached project. 2. Open up all files in editor. 3. Right click on printSomething() method in SubClass.java and Choose Refactor>>Pull Up. 4. Click Refactor. 5. Extraneous comments are added inside the method printSomething() in SuperClass.java as shown below. public void printSomething() { /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author MackSix */ System.out.println(ob.toString()); } Product Version: NetBeans IDE 7.3 RC1 (Build 201301102100) Java: 1.7.0_11; Java HotSpot(TM) 64-Bit Server VM 23.6-b04 Runtime: Java(TM) SE Runtime Environment 1.7.0_11-b21 System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb) This does not happen in v7.2.1 or in IDE Dev (Build 201301190001).