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 200706131200. Steps to reproduce: 1. Create BluePrint1 sample and BpelModule. 2. Add reference from BluePrint1 to BpelModule. 3. Add sample Loan schema to BpelModule. 4. Import created schema to purchaseOrder.xsd file of BluePrint1. 5. Rename newLoadApplication file using Refactor -> Rename. 6. Undo rename using Refactor -> Undo [Rename]. 7. Remove reference to newLoanApplication from purchaseOrder. 8. Add reference again. 9. Right click newLoanApplication and choose Refactor -> Redo [Rename] java.lang.NullPointerException at org.netbeans.modules.xml.refactoring.spi.RefactoringUtil.isDirty(RefactoringUtil.java:161) at org.netbeans.modules.xml.refactoring.spi.RefactoringUtil.getDirtyModels(RefactoringUtil.java:297) at org.netbeans.modules.xml.refactoring.XMLRefactoringTransaction.process(XMLRefactoringTransaction.java:151) at org.netbeans.modules.xml.refactoring.XMLRefactoringTransaction.commit(XMLRefactoringTransaction.java:87) at org.netbeans.modules.refactoring.api.RefactoringSession.doRefactoring(RefactoringSession.java:91) at org.netbeans.modules.refactoring.spi.impl.UndoManager$SessionUndoItem.redo(UndoManager.java:512) at org.netbeans.modules.refactoring.spi.impl.UndoManager.redo(UndoManager.java:210) at org.netbeans.modules.refactoring.spi.impl.RedoAction.performAction(RedoAction.java:74) at org.openide.util.actions.CallableSystemAction$1.run(CallableSystemAction.java:96) at org.netbeans.modules.openide.util.ActionsBridge$ActionRunnable.actionPerformed(ActionsBridge.java:89) at org.netbeans.core.ModuleActions.invokeAction(ModuleActions.java:82) at org.netbeans.modules.openide.actions.ActionsBridgeImpl.invokeAction(ActionsBridgeImpl.java:30) at org.netbeans.modules.openide.util.ActionsBridge$ActionRunnable.doRun(ActionsBridge.java:80) at org.netbeans.modules.openide.util.ActionsBridge$1.run(ActionsBridge.java:49) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:539) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:964)
When one does Refactor -> Rename, the core refactoring framework will find all "usages" of the object being renamed and keeps it in a RefactoringElementsBag. Now, when you do undo/Redo, the refactoring framework doesnt find new usages, but works with the ones in RefactoringElementsBag. When in step(7) you remove reference from newLoanApplication from purchase order and again add the reference, this is treated as a new usage even though its referring to the same file. The way schema is designed it deletes the old reference obj and creates a new reference object. This new usage is not in the RefactoringElementsBag and the refactoring framework is not aware of it. It still has old usage found in Step(5) and hence the NPE. I'll change the code to check for NPE. With this fix, the NPE will go away BUT undo/redo will still not refactor the new reference. Ideally, undo/redo should be deactivated once you make changes or save files that are participating in a refactoring. Will investigate on how to do this.
Fixed the NPE.. Still working on how to deactivate undo/redo when models change due to user actions.
*** This issue has been marked as a duplicate of 106988 ***
Redo disabled.