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 208333

Summary: Refactoring Convert Anonymous to Member doesn't fix imports
Product: java Reporter: ttokoly
Component: HintsAssignee: Jan Lahoda <jlahoda>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P3    
Version: 7.1   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:

Description ttokoly 2012-02-13 12:29:39 UTC
Product Version: NetBeans IDE 7.1 (Build 201112071828)
Java: 1.7.0_03; Java HotSpot(TM) Client VM 22.1-b02
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)

1. Unzip a project ConvertClasses to some work directory - there is link:
http://wiki.netbeans.org/wiki/images/b/be/ConvertClasses_STS_68_Refactoring.zip
2. Start IDE with a clean userdir.
3. Invoke File | Open Project... action.
4. Select unzipped projects default.
5. Scanning structure of project should be performed (it takes a while).

6. Open ClassA in editor and call refactoring for its anonymous class (Refactor -> "Convert Anonymous to Member...") on line 34.
7. Type new name and press enter.

Two errors is shown (on line 34 and on line 41), because import of ActionListener interface is missing.

I've tried this in NB 6.5 and after step 7. is on line 13 created "import java.awt.event.ActionListener;".

You can call fix imports manually and after that it's ok. So I'm not sure if this is designed behavior or not.
Comment 1 Jan Lahoda 2012-02-17 15:35:15 UTC
Same as bug #206957, as far as I can tell. Cannot reproduce on a trunk build (can reproduce on 7.1.1 RC1).

*** This bug has been marked as a duplicate of bug 206957 ***