Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 81201 - NPE in PluginDescriptor
Summary: NPE in PluginDescriptor
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: platform-runtime-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-15 11:15 EST by Kim Horne CLA
Modified: 2007-03-29 16:28 EDT (History)
3 users (show)

See Also:


Attachments
The bad view state (18.56 KB, image/jpeg)
2004-12-15 11:16 EST, Kim Horne CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kim Horne CLA 2004-12-15 11:15:39 EST
200412142000

I've been playing around with the dynamic plugin support while the PDE Runtime
view is open.  New/removed plugins are detected immediately and are reflected in
the tree.  This is cool.  However at some point (I dont know when) I noticed the
tree was "empty".  There were still nodes, but they have no labels.  When I
clicked on one I got the following NPE.  Screen cap forthcoming. 
Closing/reopening the PDE Runtime view corrected the problem.

!ENTRY org.eclipse.core.runtime 4 2 2004-12-15 11:11:16.375
!MESSAGE Problems occurred when invoking code from plug-in:
"org.eclipse.core.runtime".
!STACK 0
java.lang.NullPointerException
	at
org.eclipse.core.internal.plugins.PluginDescriptor.getPluginPrerequisites(PluginDescriptor.java:214)
	at
org.eclipse.pde.internal.runtime.registry.RegistryBrowserContentProvider.getFolderChildren(RegistryBrowserContentProvider.java:202)
	at
org.eclipse.pde.internal.runtime.registry.RegistryBrowserContentProvider.access$0(RegistryBrowserContentProvider.java:192)
	at
org.eclipse.pde.internal.runtime.registry.RegistryBrowserContentProvider$PluginFolder.getChildren(RegistryBrowserContentProvider.java:42)
	at
org.eclipse.pde.internal.runtime.registry.RegistryBrowserContentProvider.getChildren(RegistryBrowserContentProvider.java:129)
	at
org.eclipse.pde.internal.runtime.registry.RegistryBrowserContentProvider.hasChildren(RegistryBrowserContentProvider.java:228)
	at
org.eclipse.jface.viewers.AbstractTreeViewer.isExpandable(AbstractTreeViewer.java:1208)
	at org.eclipse.ui.part.DrillDownAdapter.canExpand(DrillDownAdapter.java:107)
	at org.eclipse.ui.part.DrillDownAdapter.canGoInto(DrillDownAdapter.java:142)
	at
org.eclipse.ui.part.DrillDownAdapter.updateNavigationButtons(DrillDownAdapter.java:338)
	at org.eclipse.ui.part.DrillDownAdapter.selectionChanged(DrillDownAdapter.java:328)
	at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:163)
	at
org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
	at org.eclipse.core.runtime.Platform.run(Platform.java:747)
	at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:161)
	at
org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:1667)
	at
org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:935)
	at
org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:961)
	at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:209)
	at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.java:204)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:364)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:833)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2803)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2448)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1569)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1540)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:285)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:144)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:102)
	at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:220)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
	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:324)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
	at org.eclipse.core.launcher.Main.run(Main.java:710)
	at org.eclipse.core.launcher.Main.main(Main.java:694)
Comment 1 Kim Horne CLA 2004-12-15 11:16:34 EST
Created attachment 16651 [details]
The bad view state
Comment 2 Rafael Chaves CLA 2004-12-15 16:26:00 EST
Short story is that the plug-in registry will not work properly if clients hold
on to its objects (such as IPluginDescriptors) and dynamic changes occur. I
opened bug 81322 to handle the issue in PDE/UI land. In our side, maybe we
should not be failing with a NPE, but other than failing with something else (an
assertion failed exception) or just giving an wrong answer, I don't think we can
do any better.

Any comments?
Comment 3 Wassim Melhem CLA 2004-12-15 16:32:33 EST
not sure I understand why this bug report is in the PDE bucket if the npe is 
coming from the runtime...
Comment 4 Rafael Chaves CLA 2004-12-15 16:53:08 EST
My mistake. I changed my mind and opened a separate PR for PDE, but forgot to
set the product/component accordingly.
Comment 5 DJ Houghton CLA 2007-03-29 15:52:06 EDT
Marking as wontfix. We are making minimal changes in the compatibility layer and are encouraging users to move off the compatibility code.
Comment 6 Wassim Melhem CLA 2007-03-29 15:58:57 EDT
not even an NPE?
Comment 7 DJ Houghton CLA 2007-03-29 16:24:52 EDT
Nope, its an NPE resulting from malformed user code calling methods on unsupported and stale classes.

We're happy to accept patches though if PDE feels strongly about supporting the compatibility layer forever and ever and ever and ever... :)
Comment 8 Wassim Melhem CLA 2007-03-29 16:28:27 EDT
The PDE team is pretty tied up right now doing ridiculous enhancement requests (bug 177773) for the core team ;)