Bug 125144 Clicking Show Project in Package Explorer results in exception
Clicking Show Project in Code model results in exception in DOS box === Steps to Reproduce: Create a Java project Open the Package Explorer Click the View menu Show - Projects. (This actually is a radio group menu item. It is by default selected, so clicking it again should have no effect) === Observed behaviour: Dos box: Unhandled event loop exception Reason: java.lang.NullPointerException See .log file (will be attached) === Expected behaviour: No exception === Reproducibility: yes
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
}
	
	private void selectReveal(final ISelection selection, final int count) {
		Control ctrl= getViewer().getControl();
		if (ctrl == null || ctrl.isDisposed())
			return;
		ISelection javaSelection= convertSelection(selection);
		fViewer.setSelection(javaSelection, true);
		PackageExplorerContentProvider provider= (PackageExplorerContentProvider)getViewer().getContentProvider();
		ISelection cs= fViewer.getSelection();
		
		
		
		
		if (count == 0 && provider.hasPendingChanges() && !javaSelection.equals(cs)) {
			ctrl.getDisplay().asyncExec(new Runnable() {
				public void run() {
					selectReveal(selection, count + 1);
				}
			});
		}
	}
	public ISelection convertSelection(ISelection s) {
		if (!(s instanceof IStructuredSelection))
			return s;
			
		Object[] elements= ((IStructuredSelection)s).toArray();
				
		for (int i= 0; i < elements.length; i++) 
			elements[i]= convertElement(elements[i]);