Bug 20047 NPE in ShowInPackageViewAction
20020612 found in log java.lang.NullPointerException at org.eclipse.jdt.ui.actions.ShowInPackageViewAction.run (ShowInPackageViewAction.java:138) at org.eclipse.jdt.ui.actions.ShowInPackageViewAction.run (ShowInPackageViewAction.java:109) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun (SelectionDispatchAction.java:180) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run (SelectionDispatchAction.java:156) at org.eclipse.jface.action.Action.runWithEvent(Action.java:749) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Menu.setVisible(Menu.java:920) at org.eclipse.swt.widgets.Control.WM_CONTEXTMENU(Control.java:2818) at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code)) at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code)) at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method) at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java (Compiled Code)) at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java (Compiled Code)) at org.eclipse.swt.widgets.Control.WM_RBUTTONUP(Control.java:3707) at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code)) at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code)) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.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:1160) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:739) 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:248) at org.eclipse.core.launcher.Main.run(Main.java:697) at org.eclipse.core.launcher.Main.main(Main.java:530)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ShowInPackageViewAction.java
if (element != null) {
				if (reveal(view, element))
					return;
				IResource resource= null;
				try {
					resource= element.getCorrespondingResource();
				} catch (JavaModelException e) {
				}
				if (resource != null) {
					if (reveal(view, resource))
						return;
				}
			}
			MessageDialog.openInformation(getShell(), getDialogTitle(), ActionMessages.getString("ShowInPackageViewAction.not_found")); 
		}
	}
	private boolean reveal(PackageExplorerPart view, Object element) {
		
		if (element == null)
			return false;
		view.selectReveal(new StructuredSelection(element));
		if (element.equals(getSelectedElement(view)))
			return true;
		return false;
	}
	private Object getSelectedElement(PackageExplorerPart view) {
		return ((IStructuredSelection)view.getSite().getSelectionProvider().getSelection()).getFirstElement();
	}
	
	private IJavaElement getVisibleParent(IJavaElement element) {