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.
Steps to reproduce: 1. create po.xsd 2. open po.xsd, switch to source view 3. apply russian doll design pattern, by invoking action "Apply Design Pattern' on the po.xsd node. 4. Discard the changes, now you should see the following exception. java.lang.IllegalStateException: The model is not initialized or is broken. at org.netbeans.modules.xml.xdm.XDMModel.checkStableOrParsingState(XDMModel.java:810) at org.netbeans.modules.xml.xdm.XDMModel.getDocument(XDMModel.java:673) at org.netbeans.modules.xml.xdm.xam.XDMAccess.getContainingElement(XDMAccess.java:334) at org.netbeans.modules.xml.xdm.xam.XDMAccess.getContainingElement(XDMAccess.java:63) at org.netbeans.modules.xml.xam.dom.AbstractDocumentModel.findComponent(AbstractDocumentModel.java:361) at org.netbeans.modules.xml.schema.core.multiview.SchemaSourceMultiViewElement.findNode(SchemaSourceMultiViewElement.java:388) at org.netbeans.modules.xml.schema.core.multiview.SchemaSourceMultiViewElement.access$200(SchemaSourceMultiViewElement.java:62) [catch] at org.netbeans.modules.xml.schema.core.multiview.SchemaSourceMultiViewElement$4$1.run(SchemaSourceMultiViewElement.java:336) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:461) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149) at java.awt.EventDispatchThread.run(EventDispatchThread.java:110) Any other operation on the schema that involve model flush will cause the following exception. java.lang.IllegalStateException: The model is not initialized or is broken. at org.netbeans.modules.xml.xdm.XDMModel.checkStableOrParsingState(XDMModel.java:810) at org.netbeans.modules.xml.xdm.XDMModel.getDocument(XDMModel.java:673) at org.netbeans.modules.xml.xdm.XDMModel.flush(XDMModel.java:109) at org.netbeans.modules.xml.xdm.xam.XDMAccess.flush(XDMAccess.java:93) at org.netbeans.modules.xml.xam.AbstractModel.endTransaction(AbstractModel.java:265) at org.netbeans.modules.xml.axi.impl.DefaultSchemaGenerator.transformSchema(DefaultSchemaGenerator.java:152) at org.netbeans.modules.xml.axi.impl.SchemaGeneratorFactoryImpl.transformSchema(SchemaGeneratorFactoryImpl.java:121) at org.netbeans.modules.xml.schema.abe.wizard.SchemaTransformWizard$1.run(SchemaTransformWizard.java:115) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:499) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:932)
I have fixed the part where we try to find node in source view. however, the design pattern apply does not save the model. If the file is not open at all and we try to apply design pattern and then open the file in source view, the source view does not have the save badge. Upon trying to close the file, user is shown the save, discard dialog. We get following assertion error when tried to close w/o saving. (Also same if the file is open and design pattern is applied) java.lang.AssertionError: cannot find child to remove at org.netbeans.modules.xml.xam.dom.AbstractDocumentModel.prepareSyncUnit(AbstractDocumentModel.java:231) at org.netbeans.modules.xml.schema.model.impl.SchemaModelImpl.prepareSyncUnit(SchemaModelImpl.java:247) at org.netbeans.modules.xml.xdm.xam.XDMListener.processChange(XDMListener.java:111) at org.netbeans.modules.xml.xdm.xam.XDMListener.processEvent(XDMListener.java:170) at org.netbeans.modules.xml.xdm.xam.XDMListener.propertyChange(XDMListener.java:184) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:333) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:270) at org.netbeans.modules.xml.xdm.XDMModel.fireDiffEvents(XDMModel.java:213) at org.netbeans.modules.xml.xdm.XDMModel.finishSync(XDMModel.java:183) at org.netbeans.modules.xml.xdm.XDMModel.sync(XDMModel.java:122) at org.netbeans.modules.xml.xdm.xam.XDMAccess.sync(XDMAccess.java:121) at org.netbeans.modules.xml.xam.AbstractModel.sync(AbstractModel.java:221) at org.netbeans.modules.xml.schema.core.SchemaEditorSupport.syncModel(SchemaEditorSupport.java:390) at org.netbeans.modules.xml.schema.core.multiview.SchemaSourceMultiViewElement.componentDeactivated(SchemaSourceMultiViewElement.java:278) at org.netbeans.core.multiview.MultiViewPeer.peerComponentDeactivated(MultiViewPeer.java:198) at org.netbeans.core.multiview.MultiViewCloneableTopComponent.componentDeactivated(MultiViewCloneableTopComponent.java:123) at org.openide.windows.WindowManager.activateComponent(WindowManager.java:238) at org.openide.windows.WindowManager.componentCloseNotify(WindowManager.java:303) at org.netbeans.core.windows.WindowManagerImpl.notifyTopComponentClosed(WindowManagerImpl.java:909) at org.netbeans.core.windows.Central.removeModeTopComponent(Central.java:776) at org.netbeans.core.windows.Central.userClosedTopComponent(Central.java:1545) at org.netbeans.core.windows.view.DefaultView.userClosedTopComponent(DefaultView.java:730) at org.netbeans.core.windows.view.ui.TabbedHandler.actionPerformed(TabbedHandler.java:298) at org.netbeans.swing.tabcontrol.TabbedContainer.postActionEvent(TabbedContainer.java:664) at org.netbeans.swing.tabcontrol.TabbedContainerUI.shouldPerformAction(TabbedContainerUI.java:140) at org.netbeans.swing.tabcontrol.plaf.DefaultTabbedContainerUI.access$2600(DefaultTabbedContainerUI.java:86) at org.netbeans.swing.tabcontrol.plaf.DefaultTabbedContainerUI$DisplayerActionListener.actionPerformed(DefaultTabbedContainerUI.java:1235) at org.netbeans.swing.tabcontrol.TabDisplayer.postActionEvent(TabDisplayer.java:519) at org.netbeans.swing.tabcontrol.TabDisplayerUI.shouldPerformAction(TabDisplayerUI.java:150) at org.netbeans.swing.tabcontrol.plaf.BasicTabDisplayerUI.access$1500(BasicTabDisplayerUI.java:80) at org.netbeans.swing.tabcontrol.plaf.BasicTabDisplayerUI$BasicDisplayerMouseListener.performCommand(BasicTabDisplayerUI.java:693) at org.netbeans.swing.tabcontrol.plaf.BasicTabDisplayerUI$BasicDisplayerMouseListener.potentialCommand(BasicTabDisplayerUI.java:678) at org.netbeans.swing.tabcontrol.plaf.BasicTabDisplayerUI$BasicDisplayerMouseListener.mouseReleased(BasicTabDisplayerUI.java:726) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231) at java.awt.Component.processMouseEvent(Component.java:5488) at javax.swing.JComponent.processMouseEvent(JComponent.java:3126) at java.awt.Component.processEvent(Component.java:5253) at java.awt.Container.processEvent(Container.java:1966) at java.awt.Component.dispatchEventImpl(Component.java:3955) at java.awt.Container.dispatchEventImpl(Container.java:2024) at java.awt.Component.dispatchEvent(Component.java:3803) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822) at java.awt.Container.dispatchEventImpl(Container.java:2010) at java.awt.Window.dispatchEventImpl(Window.java:1774) at java.awt.Component.dispatchEvent(Component.java:3803) at java.awt.EventQueue.dispatchEvent(EventQueue.java:463) [catch] at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149) at java.awt.EventDispatchThread.run(EventDispatchThread.java:110) subsequent file opens cause the same exception. also schema view or design view can not be opened.
I couldn't reproduce (with a local build using release55 branch ) the Assertion error for the following scenario. If the file is not open at all and we try to apply design pattern and then open the file in source view, the source view does not have the save badge. Upon trying to close the file, user is shown the save, discard dialog. We get following assertion error when tried to close w/o saving. (Also same if the file is open and design pattern is applied). However the (*) on the document did not show up, this is a minor issue, will fix.
Verified in (release_dev) build 20061005