Community
Participate
Working Groups
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)
Created attachment 16651 [details] The bad view state
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?
not sure I understand why this bug report is in the PDE bucket if the npe is coming from the runtime...
My mistake. I changed my mind and opened a separate PR for PDE, but forgot to set the product/component accordingly.
Marking as wontfix. We are making minimal changes in the compatibility layer and are encouraging users to move off the compatibility code.
not even an NPE?
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... :)
The PDE team is pretty tied up right now doing ridiculous enhancement requests (bug 177773) for the core team ;)