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 60030

Summary: Refactoring Undo should not be enabled after Fix Imports.
Product: editor Reporter: Milan Kubec <mkubec>
Component: RefactoringAssignee: issues@java <issues>
Status: VERIFIED FIXED    
Severity: blocker    
Priority: P2    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: broken source code

Description Milan Kubec 2005-06-15 13:01:32 UTC
[dev-200506142000, JDK 1.5.0_04, Experimental Refac. 0.16.0.2.3 from AUC]

I created form file with one button and let IDE create EventHandler for
actionPerformed event. I invoked Convert Anonymous Class to Inner for the
anonymous class and invoked Fix Import action after that. Undoing the
refactoring operation resulted in completly broken source code, see attachment.
Comment 1 Milan Kubec 2005-06-15 13:02:04 UTC
Created attachment 22702 [details]
broken source code
Comment 2 Jan Becicka 2005-06-15 14:28:42 UTC
It has nothing to do with Convert Anonymous Class to Inner - it can happen with
any refactoring.
Refactoring Undo should not be enabled after Fix Imports.
Comment 3 Jan Becicka 2005-06-16 15:55:53 UTC
Cannot reproduce in latest build.
Comment 4 Milan Kubec 2005-06-27 14:39:12 UTC
Easily reproducible in dev-200506261800.

Steps:
1) Creat form
2) Add button
3) Let IDE generate actionPerformed handler
4) Create Inner Class from the annon. handler class
5) Fix Imports
6) Refactor | Undo
Comment 5 Milan Kubec 2005-06-27 14:48:35 UTC
Sorry, maybe not reproducible - AUC still contains 0.16.0.2.3 version of
Experimantal Refactorings.
Comment 6 Milan Kubec 2005-06-30 09:03:00 UTC
Really reproducible in Ex. Refac. 0.17.0.2.3.
Comment 7 Jan Becicka 2005-07-22 14:14:14 UTC
Another bug fixed: user should not be allowed to refactor code in guarded block.
Checking in AnonymousToInnerRefactoringPlugin.java;
/cvs/refactoring/experimental/src/org/netbeans/modules/refactoring/experimental/plugins/AnonymousToInnerRefactoringPlugin.java,v
 <--  AnonymousToInnerRefactoringPlugin.java
new revision: 1.5; previous revision: 1.4
done
Comment 8 Milan Kubec 2005-09-22 13:34:04 UTC
Verified in dev-200509211800.