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 115381 - NPE when closing schema without saving changes
Summary: NPE when closing schema without saving changes
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Schema Tools (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Samaresh Panda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-12 18:30 UTC by tonybeckham
Modified: 2007-09-18 23:58 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tonybeckham 2007-09-12 18:30:36 UTC
Product Version: NetBeans IDE Dev (Build 200709120000) 
Java: 1.6.0; Java HotSpot(TM) Client VM 1.6.0-b105 
System: Linux version 2.6.20-16-generic running on i386; UTF-8; en_US (nb)

Problem:
If you apply a design pattern to a schema then close that schema and choose to discard changes a NPE is thrown.

Steps:
1. Create newLoan sample schema
2. Change to design view
3. Apply design pattern (any one available)
4. Close the schema and choose discard when asked if you want to save changes
5. Exception is thrown.

java.lang.NullPointerException
	at org.netbeans.modules.xml.schema.abe.ModelEventMediator.cleanUp(ModelEventMediator.java:80)
	at org.netbeans.modules.xml.schema.abe.ModelEventMediator$1.propertyChange(ModelEventMediator.java:53)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:347)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
	at java.awt.Component.firePropertyChange(Component.java:7865)
	at org.netbeans.modules.xml.schema.abe.ABEBaseDropPanel.fireComponentRemoved(ABEBaseDropPanel.java:74)
	at org.netbeans.modules.xml.schema.abe.ABEBaseDropPanel$1.propertyChange(ABEBaseDropPanel.java:64)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
	at org.netbeans.modules.xml.schema.abe.InstanceUIContext.shutdown(InstanceUIContext.java:153)
	at org.netbeans.modules.xml.schema.abe.InstanceDesignerPanel.shutdown(InstanceDesignerPanel.java:358)
	at
org.netbeans.modules.xml.schema.multiview.SchemaABEViewMultiViewElement.componentClosed(SchemaABEViewMultiViewElement.java:323)
	at org.netbeans.core.multiview.MultiViewPeer.peerComponentClosed(MultiViewPeer.java:169)
	at org.netbeans.core.multiview.MultiViewCloneableTopComponent.componentClosed(MultiViewCloneableTopComponent.java:89)
	at org.openide.windows.WindowManager.componentCloseNotify(WindowManager.java:305)
Caused: java.lang.IllegalStateException: [Winsys] TopComponent MVCTC[name=newLoanApplication.xsd *,
peer=[model=current=org.netbeans.modules.xml.schema.multiview.SchemaABEViewMultiViewDesc@94b6ff]] throws runtime
exception from its componentClosed() method. Repair it!
	at org.openide.windows.WindowManager.componentCloseNotify(WindowManager.java:307)
	at org.netbeans.core.windows.WindowManagerImpl.notifyTopComponentClosed(WindowManagerImpl.java:958)
	at org.netbeans.core.windows.Central.removeModeTopComponent(Central.java:928)
	at org.netbeans.core.windows.Central.userClosedTopComponent(Central.java:1853)
	at org.netbeans.core.windows.view.DefaultView.userClosedTopComponent(DefaultView.java:717)
	at org.netbeans.core.windows.view.ui.TabbedHandler.actionPerformed(TabbedHandler.java:299)
	at org.netbeans.swing.tabcontrol.TabbedContainer.postActionEvent(TabbedContainer.java:652)
	at org.netbeans.swing.tabcontrol.TabbedContainerUI.shouldPerformAction(TabbedContainerUI.java:140)
	at org.netbeans.swing.tabcontrol.plaf.DefaultTabbedContainerUI.access$2700(DefaultTabbedContainerUI.java:87)
	at
org.netbeans.swing.tabcontrol.plaf.DefaultTabbedContainerUI$DisplayerActionListener.actionPerformed(DefaultTabbedContainerUI.java:1236)
	at org.netbeans.swing.tabcontrol.TabDisplayer.postActionEvent(TabDisplayer.java:521)
	at org.netbeans.swing.tabcontrol.TabDisplayerUI.shouldPerformAction(TabDisplayerUI.java:154)
	at org.netbeans.swing.tabcontrol.plaf.BasicTabDisplayerUI.access$1500(BasicTabDisplayerUI.java:94)
	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:272)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
	at java.awt.Component.processMouseEvent(Component.java:6038)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
	at java.awt.Component.processEvent(Component.java:5803)
	at java.awt.Container.processEvent(Container.java:2058)
	at java.awt.Component.dispatchEventImpl(Component.java:4410)
	at java.awt.Container.dispatchEventImpl(Container.java:2116)
	at java.awt.Component.dispatchEvent(Component.java:4240)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
	at java.awt.Container.dispatchEventImpl(Container.java:2102)
	at java.awt.Window.dispatchEventImpl(Window.java:2429)
	at java.awt.Component.dispatchEvent(Component.java:4240)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
	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)
Comment 1 tonybeckham 2007-09-12 18:43:50 UTC
Can be reproduced in Schema View but the schema must have been viewed in Design View at least once before closing the
schema and discarding changes.

Steps:
1. Open a new loan sample schema
2. switch to design view  (you don't have to do any actions or even select the pane)
3. switch back to schema view
4. apply design pattern
5. Close schema discard changes
6. Get the same exception
7. on some occurrences when you reopen the schema the changes were saved and not discarded but it is not 100% of the time.
Comment 2 tonybeckham 2007-09-12 20:57:14 UTC
The patch Sam sent me fixes this issue.  When the change is checked in we can verify and close this.
Comment 3 Samaresh Panda 2007-09-12 21:35:07 UTC
Fix integrated:
/cvs/xml/schema/abe/src/org/netbeans/modules/xml/schema/abe/ModelEventMediator.java
new revision: 1.7; previous revision: 1.6
Comment 4 tonybeckham 2007-09-18 23:58:07 UTC
FIX VERIFIED in Build 200709180000.