Project: Eclipse_Platform_UI
Bug 27536 [Decorators] NPE in DecoratorOverlayIcon.drawOverlays
Reported: 2002-12-02 16:35:45 | Status: closed fixed

Delete the file org.eclipse.ui/icons/full/ovr16/link_ovr.gif Enable the Linked resource decorator. Create a link file. Will get the following NPE because overlayData is null. Thread [main] (Suspended (exception java.lang.NullPointerException)) org.eclipse.ui.internal.decorators.DecoratorOverlayIcon.drawOverlays (org.eclipse.jface.resource.ImageDescriptor[]) line: 75 org.eclipse.ui.internal.decorators.DecoratorOverlayIcon.drawCompositeIm age(int, int) line: 104 org.eclipse.ui.internal.decorators.DecoratorOverlayIcon (org.eclipse.jface.resource.CompositeImageDescriptor).getImageData() line: 184 org.eclipse.ui.internal.decorators.DecoratorOverlayIcon (org.eclipse.jface.resource.ImageDescriptor).createImage(boolean, org.eclipse.swt.graphics.Device) line: 112 org.eclipse.ui.internal.decorators.DecoratorOverlayIcon (org.eclipse.jface.resource.ImageDescriptor).createImage(boolean) line: 88 org.eclipse.ui.internal.decorators.DecoratorOverlayIcon (org.eclipse.jface.resource.ImageDescriptor).createImage() line: 77 org.eclipse.ui.internal.decorators.OverlayCache.getImageFor (org.eclipse.ui.internal.decorators.DecoratorOverlayIcon) line: 34 org.eclipse.ui.internal.decorators.OverlayCache.applyDescriptors (org.eclipse.swt.graphics.Image, org.eclipse.jface.resource.ImageDescriptor[]) line: 64 org.eclipse.ui.internal.decorators.DecorationResult.decorateWithOverlay s(org.eclipse.swt.graphics.Image, org.eclipse.ui.internal.decorators.OverlayCache) line: 60 org.eclipse.ui.internal.decorators.DecorationScheduler.decorateWithOver lays(org.eclipse.swt.graphics.Image, java.lang.Object, java.lang.Object) line: 145 org.eclipse.ui.internal.decorators.DecoratorManager.decorateImage (org.eclipse.swt.graphics.Image, java.lang.Object) line: 194 org.eclipse.jface.viewers.DecoratingLabelProvider.getImage (java.lang.Object) line: 69 org.eclipse.jface.viewers.TreeViewer.doUpdateItem (org.eclipse.swt.widgets.Item, java.lang.Object) line: 83 org.eclipse.jface.viewers.TreeViewer (org.eclipse.jface.viewers.AbstractTreeViewer).doUpdateItem (org.eclipse.swt.widgets.Widget, java.lang.Object, boolean) line: 363 org.eclipse.jface.viewers.TreeViewer (org.eclipse.jface.viewers.StructuredViewer).updateItem (org.eclipse.swt.widgets.Widget, java.lang.Object) line: 1132 org.eclipse.jface.viewers.TreeViewer (org.eclipse.jface.viewers.StructuredViewer).update(java.lang.Object, java.lang.String[]) line: 1117 org.eclipse.jface.viewers.TreeViewer (org.eclipse.jface.viewers.StructuredViewer).update(java.lang.Object[], java.lang.String[]) line: 1051 org.eclipse.jface.viewers.TreeViewer (org.eclipse.jface.viewers.StructuredViewer).handleLabelProviderChanged (org.eclipse.jface.viewers.LabelProviderChangedEvent) line: 521 org.eclipse.jface.viewers.ContentViewer$1.labelProviderChanged (org.eclipse.jface.viewers.LabelProviderChangedEvent) line: 68 org.eclipse.ui.internal.decorators.DecoratorManager.fireListeners (org.eclipse.jface.viewers.LabelProviderChangedEvent) line: 139 org.eclipse.ui.internal.decorators.DecoratorManager.labelProviderChange d(org.eclipse.jface.viewers.LabelProviderChangedEvent) line: 428 org.eclipse.ui.internal.decorators.DecorationScheduler$1.run() line: 169 org.eclipse.swt.widgets.RunnableLock.run() line: 31 org.eclipse.ui.internal.UISynchronizer (org.eclipse.swt.widgets.Synchronizer).runAsyncMessages() line: 94 org.eclipse.swt.widgets.Display.runAsyncMessages() line: 1669 org.eclipse.swt.widgets.Display.readAndDispatch() line: 1414 org.eclipse.jface.operation.ModalContext$ModalContextThread.block() line: 130 org.eclipse.jface.operation.ModalContext.run (org.eclipse.jface.operation.IRunnableWithProgress, boolean, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.swt.widgets.Display) line: 255 org.eclipse.jface.wizard.WizardDialog.run(boolean, boolean, org.eclipse.jface.operation.IRunnableWithProgress) line: 716 org.eclipse.ui.dialogs.WizardNewFileCreationPage.createNewFile() line: 198 org.eclipse.ui.wizards.newresource.BasicNewFileResourceWizard.performFi nish() line: 117 org.eclipse.jface.wizard.WizardDialog.finishPressed() line: 570 org.eclipse.jface.wizard.WizardDialog.buttonPressed(int) line: 308 org.eclipse.jface.dialogs.Dialog$1.widgetSelected (org.eclipse.swt.events.SelectionEvent) line: 398 org.eclipse.swt.widgets.TypedListener.handleEvent (org.eclipse.swt.widgets.Event) line: 87 org.eclipse.swt.widgets.EventTable.sendEvent (org.eclipse.swt.widgets.Event) line: 77 org.eclipse.swt.widgets.Button (org.eclipse.swt.widgets.Widget).sendEvent(org.eclipse.swt.widgets.Event) line: 825 org.eclipse.swt.widgets.Display.runDeferredEvents() line: 1692 org.eclipse.swt.widgets.Display.readAndDispatch() line: 1410 org.eclipse.jface.wizard.WizardDialog (org.eclipse.jface.window.Window).runEventLoop(org.eclipse.swt.widgets.Shell) line: 561 org.eclipse.jface.wizard.WizardDialog (org.eclipse.jface.window.Window).open() line: 541 org.eclipse.ui.internal.NewWizardShortcutAction.run() line: 87 org.eclipse.ui.internal.NewWizardShortcutAction (org.eclipse.jface.action.Action).runWithEvent(org.eclipse.swt.widgets.Event) line: 769 org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (org.eclipse.swt.widgets.Event) line: 411 org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (org.eclipse.swt.widgets.Event) line: 365 org.eclipse.jface.action.ActionContributionItem.access$0 (org.eclipse.jface.action.ActionContributionItem, org.eclipse.swt.widgets.Event) line: 356 org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEv ent(org.eclipse.swt.widgets.Event) line: 48 org.eclipse.swt.widgets.EventTable.sendEvent (org.eclipse.swt.widgets.Event) line: 77 org.eclipse.swt.widgets.MenuItem (org.eclipse.swt.widgets.Widget).sendEvent(org.eclipse.swt.widgets.Event) line: 825 org.eclipse.swt.widgets.Display.runDeferredEvents() line: 1692 org.eclipse.swt.widgets.Display.readAndDispatch() line: 1410 org.eclipse.ui.internal.Workbench.runEventLoop() line: 1404 org.eclipse.ui.internal.Workbench.run(java.lang.Object) line: 1387 org.eclipse.core.internal.boot.InternalBootLoader.run (java.lang.String, java.net.URL, java.lang.String, java.lang.String[], java.lang.Runnable) line: 841 org.eclipse.core.boot.BootLoader.run(java.lang.String, java.net.URL, java.lang.String, java.lang.String[]) line: 432 EclipseRuntimeLauncher.main(java.lang.String[]) line: 24

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