Bug 28442 NPE in browsing perspective
20021216 i selected the rt.jar java.lang.NullPointerException at org.eclipse.jdt.internal.ui.browsing.PackagesViewLabelProvider.getHierarchicalText(PackagesViewLabelProvider.java:145) at org.eclipse.jdt.internal.ui.browsing.PackagesViewLabelProvider.getText(PackagesViewLabelProvider.java:125) at org.eclipse.jdt.internal.ui.browsing.PackagesViewLabelProvider.getText(PackagesViewLabelProvider.java:114) at org.eclipse.jface.viewers.DecoratingLabelProvider.getText(DecoratingLabelProvider.java:100) at org.eclipse.jdt.internal.ui.browsing.PackagesView$3.getText(PackagesView.java:533) at org.eclipse.jface.viewers.TreeViewer.doUpdateItem(TreeViewer.java:96) at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:363) at org.eclipse.jdt.internal.ui.browsing.PackagesViewTreeViewer.doUpdateItem(PackagesViewTreeViewer.java:127) at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:1132) at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:267) at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:252) at org.eclipse.jface.viewers.AbstractTreeViewer$2.run(AbstractTreeViewer.java:655) at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:684) at org.eclipse.jface.viewers.AbstractTreeViewer.inputChanged(AbstractTreeViewer.java:647) at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:232) at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:871) at org.eclipse.jdt.internal.ui.browsing.PackageViewerWrapper.setViewerInput(PackageViewerWrapper.java:306) at org.eclipse.jdt.internal.ui.browsing.PackagesView.setViewerWrapperInput(PackagesView.java:321) at org.eclipse.jdt.internal.ui.browsing.PackagesView.setInput(PackagesView.java:316) at org.eclipse.jdt.internal.ui.browsing.PackagesView.adjustInputAndSetSelection(PackagesView.java:590) at org.eclipse.jdt.internal.ui.browsing.JavaBrowsingPart.selectionChanged(JavaBrowsingPart.java:657) at org.eclipse.ui.internal.AbstractSelectionService$4.run(AbstractSelectionService.java:162) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java(Compiled Code)) at org.eclipse.core.runtime.Platform.run(Platform.java(Compiled Code)) at org.eclipse.ui.internal.AbstractSelectionService.firePostSelection(AbstractSelectionService.java:160) at org.eclipse.ui.internal.AbstractSelectionService$2.selectionChanged(AbstractSelectionService.java:60) at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:330) at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:554) at org.eclipse.jface.viewers.StructuredViewer$2.widgetSelected(StructuredViewer.java:572) at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:192) at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:187) at org.eclipse.jface.util.OpenStrategy$3.run(OpenStrategy.java:327) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java(Compiled Code)) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java(Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java(Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java(Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java(Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1386) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:845) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:247) at org.eclipse.core.launcher.Main.run(Main.java:703) at org.eclipse.core.launcher.Main.main(Main.java:539)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/PackagesViewLabelProvider.java
IPackageFragment[] fragments= logicalPackage.getFragments();
		return getText(fragments[0]);
	}
	
	private String getFlatText(IPackageFragment fragment) {
		return super.getText(fragment);
	}
	
	private boolean isFlatView() {
		return fViewState==FLAT_VIEW_STATE;
	}
	private String getHierarchicalText(IPackageFragment fragment) {
		if (fragment.isDefaultPackage()) {
			return super.getText(fragment);
		}
		String name= fragment.getResource().getName();
		return decorateText(name, fragment);
	}
	
	private String decorateText(String name, Object element) {
		if (fLabelDecorators == null)
			return name;
		for (int i= 0; i < fLabelDecorators.size(); i++) {
			ILabelDecorator decorator= (ILabelDecorator) fLabelDecorators.get(i);
			name= decorator.decorateText(name, element);
		}
		return name;	
	}
	
	private class ElementImageProvider extends JavaElementImageProvider{