Bug 91809 Packages view throws NPE on creation
Running with code in HEAD, 20050418 Switch to the Java Browsing perspective. I get: java.lang.NullPointerException at org.eclipse.jdt.internal.ui.browsing.PackagesView.findInputForJavaElement(PackagesView.java:545) at org.eclipse.jdt.internal.ui.browsing.JavaBrowsingPart.setInitialInput(JavaBrowsingPart.java:898) at org.eclipse.jdt.internal.ui.browsing.JavaBrowsingPart.createPartControl(JavaBrowsingPart.java:374) at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:305) at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:182) at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:492) at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:265) at org.eclipse.ui.internal.ViewPane.setVisible(ViewPane.java:514) at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:126) at org.eclipse.ui.internal.presentations.newapi.PresentablePartFolder.select(PresentablePartFolder.java:268) at org.eclipse.ui.internal.presentations.newapi.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65) at org.eclipse.ui.internal.presentations.newapi.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:391) at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1064) at org.eclipse.ui.internal.PartStack.createControl(PartStack.java:552) at org.eclipse.ui.internal.PartStack.createControl(PartStack.java:489) at org.eclipse.ui.internal.PartSashContainer.createControl(PartSashContainer.java:485) at org.eclipse.ui.internal.PerspectiveHelper.activate(PerspectiveHelper.java:230) at org.eclipse.ui.internal.Perspective.onActivate(Perspective.java:781) at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:2742) at org.eclipse.ui.internal.WorkbenchPage.busySetPerspective(WorkbenchPage.java:870) at org.eclipse.ui.internal.WorkbenchPage.access$9(WorkbenchPage.java:855) at org.eclipse.ui.internal.WorkbenchPage$12.run(WorkbenchPage.java:2864) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:2862) at org.eclipse.ui.internal.PerspectiveBarContributionItem.select(PerspectiveBarContributionItem.java:109) at org.eclipse.ui.internal.PerspectiveBarContributionItem$1.widgetSelected(PerspectiveBarContributionItem.java:81) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:842) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2897) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2530) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1570) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1534) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:306) 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:228) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:156) 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:319) at org.eclipse.core.launcher.Main.basicRun(Main.java:272) at org.eclipse.core.launcher.Main.run(Main.java:951) at org.eclipse.core.launcher.Main.main(Main.java:935)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/PackagesView.java
private MultiActionGroup createSwitchActionGroup(){
		
		LayoutAction switchToFlatViewAction= new LayoutAction(JavaBrowsingMessages.PackagesView_flatLayoutAction_label,LIST_VIEW_STATE); 
		LayoutAction switchToHierarchicalViewAction= new LayoutAction(JavaBrowsingMessages.PackagesView_HierarchicalLayoutAction_label, TREE_VIEW_STATE); 
		JavaPluginImages.setLocalImageDescriptors(switchToFlatViewAction, "flatLayout.gif"); 
		JavaPluginImages.setLocalImageDescriptors(switchToHierarchicalViewAction, "hierarchicalLayout.gif"); 
			
		return new LayoutActionGroup(new IAction[]{switchToFlatViewAction,switchToHierarchicalViewAction}, fCurrViewState);
	}
	
	private static class LayoutActionGroup extends MultiActionGroup {
		LayoutActionGroup(IAction[] actions, int index) {
			super(actions, index);
		}
		public void fillActionBars(IActionBars actionBars) {
			
			IMenuManager manager= actionBars.getMenuManager();
			final IContributionItem groupMarker= new GroupMarker("layout"); 
			manager.add(groupMarker);
			IMenuManager newManager= new MenuManager(JavaBrowsingMessages.PackagesView_LayoutActionGroup_layout_label); 
			manager.appendToGroup("layout", newManager); 
			super.addActions(newManager);
		}
	}
	
	/**
	 * Switches between flat and hierarchical state.
	 */
	private class LayoutAction extends Action {