Bug 227721 [Decorators] ContentTypeDecorator causes NPE in JFaceResources.getResources
I20080415-1646. Found in .log: !ENTRY org.eclipse.ui 4 4 2008-04-18 10:25:59.887 !MESSAGE java.lang.NullPointerException !STACK 0 java.lang.NullPointerException at org.eclipse.jface.resource.JFaceResources.getResources(JFaceResources.java:205) at org.eclipse.jface.resource.ImageRegistry.<init>(ImageRegistry.java:151) at org.eclipse.jface.resource.ImageRegistry.<init>(ImageRegistry.java:123) at org.eclipse.ui.internal.WorkbenchImages.initializeImageRegistry(WorkbenchImages.java:570) at org.eclipse.ui.internal.WorkbenchImages.getDescriptors(WorkbenchImages.java:471) at org.eclipse.ui.internal.WorkbenchImages.getImageDescriptor(WorkbenchImages.java:501) at org.eclipse.ui.internal.registry.EditorRegistry.addSystemEditors(EditorRegistry.java:549) at org.eclipse.ui.internal.registry.EditorRegistry.initialIdToEditorMap(EditorRegistry.java:513) at org.eclipse.ui.internal.registry.EditorRegistry.<init>(EditorRegistry.java:134) at org.eclipse.ui.internal.WorkbenchPlugin.getEditorRegistry(WorkbenchPlugin.java:455) at org.eclipse.ui.internal.Workbench.getEditorRegistry(Workbench.java:1132) at org.eclipse.ui.internal.ide.ContentTypeDecorator.decorate(ContentTypeDecorator.java:49) at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.decorate(LightweightDecoratorDefinition.java:269) at org.eclipse.ui.internal.decorators.LightweightDecoratorManager$LightweightRunnable.run(LightweightDecoratorManager.java:72) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.decorate(LightweightDecoratorManager.java:356) at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.getDecorations(LightweightDecoratorManager.java:338) at org.eclipse.ui.internal.decorators.DecorationScheduler$1.ensureResultCached(DecorationScheduler.java:374) at org.eclipse.ui.internal.decorators.DecorationScheduler$1.run(DecorationScheduler.java:334) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/ContentTypeDecorator.java
/*******************************************************************************
 * Copyright (c) 2005, 2008 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.ui.internal.ide;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.content.IContentDescription;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.IDecoration;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ILightweightLabelDecorator;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.internal.ide.model.WorkbenchFile;
/**
 * Lightweight decorator for more specific file icons.
 * 
 * @since 3.4
 * 
 */
public class ContentTypeDecorator implements ILightweightLabelDecorator {