Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 252589

Summary: [Editor] Null pointer exception when deleting a simple type in the drilled down design view
Product: [WebTools] WTP Source Editing Reporter: Steven Hung <sghung>
Component: wst.xsdAssignee: Keith Chong <keith.chong.ca>
Status: CLOSED FIXED QA Contact: Keith Chong <keith.chong.ca>
Severity: normal    
Priority: P3 CC: patric, valentinbaciu
Version: 3.1   
Target Milestone: 3.1 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Steven Hung CLA 2008-10-29 10:20:05 EDT
Build ID: WTP 3.1

Steps To Reproduce:
This exception is printed to the console when debugging or running the Eclipse Application for the XSD editor.  This error is a silent error, which does not show up in the Eclipse application itself.  Other than the null pointer exception, the expected behavior for deleting and undo remains unchanged.

1. Check out the latest org.eclipse.wst.xsd.ui plugin and run in debug mode
2. Open GolfCountryClub/GolfCountryClub.xsd
3. Create a new simple type in the design view
4. Open the drill downed view of the simple type by double clicking on the newly created simple type (i.e. no longer in the schema index view)
5. Delete the simple type

The stack trace is as follows:

java.lang.NullPointerException
	at org.eclipse.xsd.util.XSDConstants.lookupQualifier(XSDConstants.java:1433)
	at org.eclipse.xsd.impl.XSDNamedComponentImpl.getQName(XSDNamedComponentImpl.java:654)
	at org.eclipse.wst.xsd.ui.internal.adapters.XSDSimpleTypeDefinitionAdapter.getText(XSDSimpleTypeDefinitionAdapter.java:68)
	at org.eclipse.wst.xsd.ui.internal.adapters.XSDSimpleTypeDefinitionAdapter.getText(XSDSimpleTypeDefinitionAdapter.java:49)
	at org.eclipse.wst.xsd.ui.internal.adt.outline.ADTLabelProvider.getText(ADTLabelProvider.java:44)
	at org.eclipse.wst.xsd.ui.internal.adt.outline.ADTContentOutlinePage$StatusLineLabelProvider.getText(ADTContentOutlinePage.java:311)
	at org.eclipse.wst.xsd.ui.internal.adt.outline.ADTContentOutlinePage.updateStatusLine(ADTContentOutlinePage.java:283)
	at org.eclipse.wst.xsd.ui.internal.adt.outline.ADTContentOutlinePage$SelectionManagerSelectionChangeListener.selectionChanged(ADTContentOutlinePage.java:160)
	at org.eclipse.wst.xsd.ui.internal.adt.editor.CommonSelectionManager.setSelection(CommonSelectionManager.java:98)
	at org.eclipse.wst.xsd.ui.internal.adt.editor.CommonSelectionManager.selectionChanged(CommonSelectionManager.java:71)
	at org.eclipse.wst.xsd.ui.internal.adt.design.DesignViewGraphicalViewer$ADTSelectionChangedListener.notifyListeners(DesignViewGraphicalViewer.java:218)
	at org.eclipse.wst.xsd.ui.internal.adt.design.DesignViewGraphicalViewer$ADTSelectionChangedListener.selectionChanged(DesignViewGraphicalViewer.java:255)
	at org.eclipse.gef.ui.parts.AbstractEditPartViewer.fireSelectionChanged(AbstractEditPartViewer.java:243)
	at org.eclipse.gef.ui.parts.AbstractEditPartViewer$1.run(AbstractEditPartViewer.java:129)
	at org.eclipse.gef.SelectionManager.fireSelectionChanged(SelectionManager.java:115)
	at org.eclipse.gef.SelectionManager.deselect(SelectionManager.java:92)
	at org.eclipse.gef.ui.parts.AbstractEditPartViewer.deselect(AbstractEditPartViewer.java:200)
	at org.eclipse.gef.editparts.AbstractEditPart.removeNotify(AbstractEditPart.java:866)
	at org.eclipse.gef.editparts.AbstractGraphicalEditPart.removeNotify(AbstractGraphicalEditPart.java:731)
	at org.eclipse.gef.editparts.AbstractEditPart.removeNotify(AbstractEditPart.java:873)
	at org.eclipse.gef.editparts.AbstractGraphicalEditPart.removeNotify(AbstractGraphicalEditPart.java:731)
	at org.eclipse.gef.editparts.AbstractEditPart.removeNotify(AbstractEditPart.java:873)
	at org.eclipse.gef.editparts.AbstractGraphicalEditPart.removeNotify(AbstractGraphicalEditPart.java:731)
	at org.eclipse.gef.editparts.AbstractEditPart.removeChild(AbstractEditPart.java:811)
	at org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(AbstractEditPart.java:735)
	at org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractEditPart.java:677)
	at org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh(AbstractGraphicalEditPart.java:571)
	at org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart.refresh(BaseEditPart.java:120)
	at org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart.refresh(RootContentEditPart.java:146)
	at org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart.propertyChanged(BaseEditPart.java:112)
	at org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter.notifyListeners(XSDBaseAdapter.java:92)
	at org.eclipse.wst.xsd.ui.internal.adapters.XSDSchemaAdapter.notifyChanged(XSDSchemaAdapter.java:272)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:247)
	at org.eclipse.xsd.impl.XSDConcreteComponentImpl.eNotify(XSDConcreteComponentImpl.java:1283)
	at org.eclipse.emf.ecore.util.EcoreEList.dispatchNotification(EcoreEList.java:255)
	at org.eclipse.emf.common.notify.impl.NotifyingListImpl.remove(NotifyingListImpl.java:731)
	at org.eclipse.emf.common.util.BasicEList.remove(BasicEList.java:898)
	at org.eclipse.xsd.impl.XSDSchemaImpl$4.caseXSDTypeDefinition(XSDSchemaImpl.java:1954)
	at org.eclipse.xsd.util.XSDSwitch.doSwitch(XSDSwitch.java:656)
	at org.eclipse.xsd.util.XSDSwitch.doSwitch(XSDSwitch.java:88)
	at org.eclipse.xsd.util.XSDSwitch.doSwitch(XSDSwitch.java:74)
	at org.eclipse.xsd.impl.XSDSchemaImpl.orphanContent(XSDSchemaImpl.java:1975)
	at org.eclipse.xsd.impl.XSDConcreteComponentImpl.eNotify(XSDConcreteComponentImpl.java:1214)
	at org.eclipse.emf.ecore.util.EcoreEList.dispatchNotification(EcoreEList.java:255)
	at org.eclipse.emf.common.notify.impl.NotifyingListImpl.remove(NotifyingListImpl.java:719)
	at org.eclipse.emf.common.util.BasicEList.remove(BasicEList.java:898)
	at org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand.execute(DeleteCommand.java:162)
	at org.eclipse.gef.commands.CommandStack.execute(CommandStack.java:170)
	at org.eclipse.wst.xsd.ui.internal.common.actions.DeleteXSDConcreteComponentAction.run(DeleteXSDConcreteComponentAction.java:59)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:412)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3848)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3446)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:333)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:370)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:618)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1212)


More information:
Comment 1 Valentin Baciu CLA 2008-10-29 10:25:03 EDT
The stack trace looks similar to the one attached to bug 252057.
Comment 2 Keith Chong CLA 2008-11-14 14:55:59 EST
Targetting fix for 3.1 M4.
Comment 3 Keith Chong CLA 2008-12-09 23:53:03 EST
Released for 3.1 M4.
Comment 4 Keith Chong CLA 2008-12-17 12:02:14 EST
Verified in wtp-sdk-S-3.1M4-20081215095735. Closing bug.
Comment 5 Patric Rufflar CLA 2012-02-14 06:17:11 EST
I'm still seeing a similar exception in a WTP 3.2.4 build:

java.lang.NullPointerException
at org.eclipse.xsd.util.XSDConstants.lookupQualifier(XSDConstants.java:1433)
at org.eclipse.xsd.impl.XSDNamedComponentImpl.getQName(XSDNamedComponentImpl.java:654)
at org.eclipse.wst.xsd.ui.internal.common.properties.sections.XSDAttributeDeclarationSection.refresh(XSDAttributeDeclarationSection.java:360)
at org.eclipse.ui.views.properties.tabbed.TabContents$6.run(TabContents.java:217)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.ui.views.properties.tabbed.TabContents.refresh(TabContents.java:220)
at org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage.refresh(TabbedPropertySheetPage.java:749)
at org.eclipse.wst.xsd.ui.internal.editor.XSDTabbedPropertySheetPage$InternalNodeAdapter.notifyChanged(XSDTabbedPropertySheetPage.java:153)
at org.eclipse.wst.xsd.ui.internal.util.ModelReconcileAdapter.notifyListeners(ModelReconcileAdapter.java:54)
at org.eclipse.wst.xsd.ui.internal.util.ModelReconcileAdapter.notifyChanged(ModelReconcileAdapter.java:66)
at org.eclipse.wst.sse.core.internal.provisional.AbstractNotifier.notify(AbstractNotifier.java:202)
at org.eclipse.wst.xml.core.internal.document.XMLModelNotifierImpl.notify(XMLModelNotifierImpl.java:238)
at org.eclipse.wst.xml.core.internal.document.XMLModelNotifierImpl.notifyDeferred(XMLModelNotifierImpl.java:340)
at org.eclipse.wst.xml.core.internal.document.XMLModelNotifierImpl.endChanging(XMLModelNotifierImpl.java:178)
at org.eclipse.wst.xml.core.internal.document.DOMModelImpl.changedModel(DOMModelImpl.java:163)
at org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel$DocumentToModelNotifier.nodesReplaced(AbstractStructuredModel.java:152)
at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument._fireEvent(BasicStructuredDocument.java:600)
at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.fireStructuredDocumentEvent(BasicStructuredDocument.java:1199)
at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.internalReplaceText(BasicStructuredDocument.java:1979)
at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2419)
at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.set(BasicStructuredDocument.java:2931)
at org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer.handleFileContentChanged(ResourceTextFileBuffer.java:508)
at org.eclipse.core.internal.filebuffers.ResourceFileBuffer$2.execute(ResourceFileBuffer.java:151)
at org.eclipse.core.internal.filebuffers.ResourceFileBuffer$SafeFileChange.run(ResourceFileBuffer.java:86)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1408)