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.
1. Create some schema. 2. DnD it to other destination. 3. Press Refactor. Same for other ways of doing move refactoring (Refactor -> Move... in main menu, Cut/Paste) Result: exception comes. This is a regression. java.lang.NullPointerException at org.netbeans.modules.xml.schema.SchemaEditorSupport.checkCharsetConversion(SchemaEditorSupport.java:553) at org.netbeans.modules.xml.schema.SchemaEditorSupport.saveDocument(SchemaEditorSupport.java:477) at org.netbeans.modules.xml.schema.SchemaDataObject$1.save(SchemaDataObject.java:209) at org.netbeans.core.NbTopManager.saveAll(NbTopManager.java:283) at org.netbeans.core.NbTopManager.access$300(NbTopManager.java:90) at org.netbeans.core.NbTopManager$NbLifecycleManager.saveAll(NbTopManager.java:440) at org.netbeans.modules.refactoring.spi.impl.RefactoringPanel.refresh(RefactoringPanel.java:597) at org.netbeans.modules.refactoring.spi.impl.RefactoringPanel.<init>(RefactoringPanel.java:139) at org.netbeans.modules.refactoring.spi.impl.RefactoringPanel.<init>(RefactoringPanel.java:131) at org.netbeans.modules.refactoring.spi.ui.UI.openRefactoringUI(UI.java:72) at org.netbeans.modules.xml.refactoring.XMLRefactoringActionsProvider.doMove(XMLRefactoringActionsProvider.java:242) at org.netbeans.modules.refactoring.api.impl.ActionsImplementationFactory.doMove(ActionsImplementationFactory.java:113) at org.netbeans.modules.refactoring.spi.impl.MoveAction.performAction(MoveAction.java:62) at org.netbeans.modules.refactoring.spi.impl.RefactoringGlobalAction$ContextAction.actionPerformed(RefactoringGlobalAction.java:177) [catch] at org.netbeans.modules.refactoring.impl.ClipboardConvertor$RefactoringPaste$RefactoringPasteType$1.run(ClipboardConvertor.java:140) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Product Version: NetBeans IDE 6.0 Beta 2 (Build 200710160000) Java: 1.5.0_07; Java HotSpot(TM) Client VM 1.5.0_07-87 System: Mac OS X version 10.4.10 running on i386; MacRoman; en_US (nb) For the same build but on Linux w/ Java 1.6.0_03 this is what happens for me. 1. The first move refactor does not throw any exceptions 2. The schema is moved but then it is immediately recreated at the same location that it was moved from thus there are 2 identical schemas. 3. Moving either of the two will throw the exception(in the log file, not in the IDE). You can delete one of them but exception still comes. 4. Trying to close the project brings up the save changes dialog but it is empty and you can discard or save it doesn't matter 5. Trying to delete the project via the context menu in the ide throws exception in the ide that is almost the same as the one in the log file,only a little bit longer. (see attachment).
Created attachment 51047 [details] Exception in ide when try to delete project
The fix is in trunk. Checking in XMLRefactoringTransaction.java; /cvs/xml/refactoring/src/org/netbeans/modules/xml/refactoring/XMLRefactoringTransaction.java,v <-- XMLRefactoringTransaction.java new revision: 1.19; previous revision: 1.18 done Checking in spi/RefactoringUtil.java; /cvs/xml/refactoring/src/org/netbeans/modules/xml/refactoring/spi/RefactoringUtil.java,v <-- RefactoringUtil.java new revision: 1.8; previous revision: 1.7 done Once the QE verifies the fix, I will request for integration with beta2 branch
The bug was in our save method. In the save method, we were setting the usage models to dirty. AS a result, in case of move refactoring, the code was trying to save a file that has already moved, hence the NPE. Changed code to use BackupFacility for undo/redo and removed save. The core refactoring framework saves all the changes after refactoring/undo. We don't need to save the refactored files, the framework will take care of it.
Product Version: NetBeans IDE Dev (Build 20071017142729) Java: 1.5.0_07; Java HotSpot(TM) Client VM 1.5.0_07-87 System: Mac OS X version 10.4.10 running on i386; MacRoman; en_US (nb) Fix Verified in trunk on Mac OS.
Fix verified in trunk on WinXP as well.
Fix integrated into release60_beta2 branch
Fix Verified: Product Version: NetBeans IDE 6.0 Beta 2 (Build 200710212201) Java: 1.5.0_07; Java HotSpot(TM) Client VM 1.5.0_07-87 System: Mac OS X version 10.4.10 running on i386; MacRoman; en_US (nb) and in trunk on XP as desc7 states.