Bug 99585 NPE in FileSpec
3.1 RC2 Steps to reproduce: - Checkout project org.eclipse.jdt.ui.vcm - Expand project in the package explorer - Browse through the folders of the JRE_LIB container -> The following exception occurs: java.lang.NullPointerException at org.eclipse.core.internal.content.FileSpec.getMappingKeyFor (FileSpec.java:57) at org.eclipse.core.internal.content.ContentTypeCatalog.getDirectlyAssociated (ContentTypeCatalog.java:454) at org.eclipse.core.internal.content.ContentTypeCatalog.internalFindContentTypesFo r(ContentTypeCatalog.java:409) at org.eclipse.core.internal.content.ContentTypeCatalog.findContentTypesFor (ContentTypeCatalog.java:263) at org.eclipse.core.internal.content.ContentTypeMatcher.findContentTypeFor (ContentTypeMatcher.java:49) at org.eclipse.ui.internal.registry.EditorRegistry.guessAtContentType (EditorRegistry.java:338) at org.eclipse.ui.internal.registry.EditorRegistry.getImageDescriptor (EditorRegistry.java:382) at org.eclipse.jdt.internal.ui.viewsupport.StorageLabelProvider.getDefaultImage (StorageLabelProvider.java:133) at org.eclipse.jdt.internal.ui.viewsupport.StorageLabelProvider.getImageForJarEntr y(StorageLabelProvider.java:11 6) at org.eclipse.jdt.internal.ui.viewsupport.StorageLabelProvider.getImage (StorageLabelProvider.java:52) at org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider.getImage (JavaUILabelProvider.java:140) at org.eclipse.jdt.internal.ui.packageview.WorkingSetAwareLabelProvider.getImage (WorkingSetAwareLabelProvider.ja va:54) at org.eclipse.jface.viewers.DecoratingLabelProvider.getImage (DecoratingLabelProvider.java:82) at org.eclipse.jface.viewers.DecoratingLabelProvider.updateLabel (DecoratingLabelProvider.java:212) 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:1038) at org.eclipse.core.runtime.Platform.run(Platform.java:775) 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:1038) at org.eclipse.core.runtime.Platform.run(Platform.java:775) 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:179) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:844) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:868) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:853) at org.eclipse.swt.widgets.Tree.wmNotifyChild(Tree.java:3703) at org.eclipse.swt.widgets.Control.WM_NOTIFY(Control.java:3567) at org.eclipse.swt.widgets.Composite.WM_NOTIFY(Composite.java:1035) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3088) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3679) at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:1578) at org.eclipse.swt.widgets.Tree.callWindowProc(Tree.java:219) at org.eclipse.swt.widgets.Tree.WM_LBUTTONDOWN(Tree.java:2814) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3070) at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:2390) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3679) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1654) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2686) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1717) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1681) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench (Workbench.java:366) 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:85) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:58) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:60) at java.lang.reflect.Method.invoke(Method.java:391) 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)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/StorageLabelProvider.java
if (fJarImageMap != null) {
			Iterator each= fJarImageMap.values().iterator();
			while (each.hasNext()) {
				Image image= (Image)each.next();
				image.dispose();
			}
			fJarImageMap= null;
		}
		if (fDefaultImage != null)
			fDefaultImage.dispose();
		fDefaultImage= null;
	}
	
	/*
	 * Gets and caches an image for a JarEntryFile.
	 * The image for a JarEntryFile is retrieved from the EditorRegistry.
	 */ 
	private Image getImageForJarEntry(IStorage element) {
		if (fJarImageMap == null)
			return getDefaultImage();
		if (element == null || element.getName() == null)
			return getDefaultImage();
		
		String name= element.getName();
		Image image= (Image)fJarImageMap.get(name);
		if (image != null) 
			return image;
		IFileEditorMapping[] mappings= getEditorRegistry().getFileEditorMappings();
		int i= 0;
		while (i < mappings.length) {