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.
Build: NetBeans IDE Dev (Build 201203271056) VM: Java HotSpot(TM) Client VM, 22.1-b02, Java(TM) SE Runtime Environment, 1.7.0_03-b04 OS: Linux User Comments: aldobrucale: I moved a method and an inner class from a class to another; the inner class did not move; I tried to undo all refactorings but the last dialog asked if I really wanted to undo "null"; I said yes and got NPE Stacktrace: java.lang.NullPointerException at org.openide.text.UndoRedoManager.editToBeUndoneRedone(UndoRedoManager.java:569) at org.openide.text.NbDocument.getEditToBeUndoneRedoneOfType(NbDocument.java:572) at org.openide.text.NbDocument.getEditToBeUndoneOfType(NbDocument.java:559) at org.openide.text.NbDocument$APIAccessorImpl.getEditToBeUndoneOfType(NbDocument.java:548) at org.netbeans.modules.openide.text.NbDocumentRefactoringHack.getEditToBeUndoneOfType(NbDocumentRefactoringHack.java:73) at org.netbeans.modules.refactoring.spi.BackupFacility2$DefaultImpl.checkChecksum(BackupFacility2.java:256)
Created attachment 117414 [details] stacktrace
Created attachment 117424 [details] stacktrace 1. Unzip a project default to some work directory - there is link: http://wiki.netbeans.org/wiki/images/2/2d/Default_TS_60_Refactoring.zip 2. Start IDE with a clean userdir 3. Invoke File | Open Project... action 4. Select unzipped project default 5. Scanning structure of project should be performed (it takes a while) 6. Put caret on field protectedProperty of the org.netbeans.tests.examples.packb.BeanA class in the Project view and invoke Refactor | Rename action from the popup menu. 7. Fill a new field name protectedPropertyRenamed, check checkbox 'Rename Getters and Setters' and confirm this dialog. There should be displayed a warning: O There are methods in subclasses/implementors of BeanA that override or implement this method. They will also be renamed. 8. If you agree with these changes press Do Refactoring button and changes will be performed. 9. Pressed Undo action. 10. This error shows up.
Created attachment 117425 [details] stacktrace Same as before: Undo action after renaming a field with getters and setters.
Created attachment 117968 [details] stacktrace Undo a moved JFrame form with Internationlization.
I've reproduced the problem in a project attached by ttokoly according to given steps. I've fixed the NPE but undo of the refactoring does not succeed although I did no extra modifications (see attached analysis) so reassigning to refactoring for further evaluation. openide.text partial fix: http://hg.netbeans.org/jet-main/rev/248f9b21ad44
Created attachment 118141 [details] Analysis of the undo/redo performed during refactoring and its undo.
Integrated into 'main-golden', will be available in build *201204130400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/248f9b21ad44 User: Miloslav Metelka <mmetelka@netbeans.org> Log: #210294 - NullPointerException at org.openide.text.UndoRedoManager.editToBeUndoneRedone - partial fix (in openide.text).
Changeset: 582fe89d41b3 Author: Jan Becicka <jbecicka@netbeans.org> Date: 2012-04-13 16:16 Message: Issue #210294 - NullPointerException at org.openide.text.UndoRedoManager.editToBeUndoneRedone
Integrated into 'main-golden', will be available in build *201204140400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/582fe89d41b3 User: Jan Becicka <jbecicka@netbeans.org> Log: Issue #210294 - NullPointerException at org.openide.text.UndoRedoManager.editToBeUndoneRedone
Product Version: NetBeans IDE 7.1.2 (Build 201204101705) Java: 1.7.0_04; Java HotSpot(TM) Client VM 23.0-b21 System: Linux version 3.0.0-17-generic running on i386; UTF-8; en_US (nb) Verified, works for me now. Thanks :) .