Project: Eclipse_Platform_UI
Bug 106360 NPE when defining a decorator with no enablement
Reported: 2005-08-08 11:17:12 | Status: verified fixed

20050808 If you have no enablement on your decorator then you will get an NPE. We should also consider setting the enablement as a required value as you will never enable without it. !ENTRY org.eclipse.jface 4 2 2005-08-08 11:10:14.890 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface". !STACK 0 java.lang.NullPointerException at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.initializeEnablement(LightweightDecoratorDefinition.java:276) at org.eclipse.ui.internal.decorators.DecoratorDefinition.getEnablement(DecoratorDefinition.java:167) at org.eclipse.ui.internal.decorators.DecoratorRegistryReader.readElement(DecoratorRegistryReader.java:52) at org.eclipse.ui.internal.registry.RegistryReader.readElements(RegistryReader.java:138) at org.eclipse.ui.internal.registry.RegistryReader.readExtension(RegistryReader.java:148) at org.eclipse.ui.internal.registry.RegistryReader.readRegistry(RegistryReader.java:168) at org.eclipse.ui.internal.decorators.DecoratorRegistryReader.readRegistry(DecoratorRegistryReader.java:102) at org.eclipse.ui.internal.decorators.DecoratorManager.initializeDecoratorDefinitions(DecoratorManager.java:114) at org.eclipse.ui.internal.decorators.DecoratorManager.getLightweightManager(DecoratorManager.java:797) at org.eclipse.ui.internal.decorators.DecoratorManager.prepareDecoration(DecoratorManager.java:821) at org.eclipse.jface.viewers.DecoratingLabelProvider.updateLabel(DecoratingLabelProvider.java:199) at org.eclipse.jface.viewers.StructuredViewer.buildLabel(StructuredViewer.java:1855) at org.eclipse.jface.viewers.TreeViewer.doUpdateItem(TreeViewer.java:228) at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run(AbstractTreeViewer.java:85) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044) at org.eclipse.core.runtime.Platform.run(Platform.java:783) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148) at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:621) at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:434) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044) at org.eclipse.core.runtime.Platform.run(Platform.java:783) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148) at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:1763) at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:535) at org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractTreeViewer.java:514) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:494) at org.eclipse.jface.viewers.AbstractTreeViewer.handleTreeExpand(AbstractTreeViewer.java:948) at org.eclipse.jface.viewers.AbstractTreeViewer$4.treeExpanded(AbstractTreeViewer.java:959) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:180) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:858) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:882) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:867) at org.eclipse.swt.widgets.Tree.wmNotifyChild(Tree.java:4343) at org.eclipse.swt.widgets.Control.WM_NOTIFY(Control.java:3599) at org.eclipse.swt.widgets.Composite.WM_NOTIFY(Composite.java:1091) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3110) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3773) at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:1604) at org.eclipse.swt.widgets.Tree.callWindowProc(Tree.java:223) at org.eclipse.swt.widgets.Tree.WM_LBUTTONDOWN(Tree.java:3327) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3091) at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:2903) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3773) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1680) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2763) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1734) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1698) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) 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.invokeFramework(Main.java:334) at org.eclipse.core.launcher.Main.basicRun(Main.java:278) at org.eclipse.core.launcher.Main.run(Main.java:973) at org.eclipse.core.launcher.Main.main(Main.java:948)

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/LightweightDecoratorDefinition.java