Bug 102494 [navigation] NPE finding occurences of static initializer
I20050627 Steps: 1) Open the type hierarchy of a source class that has a static initializer. 2) In the lower pane of the Hiearchy tab, rightclick on the static initializer and pick menu item OccurencesInFile>>Identifier. See this NPE in the Error Log: java.lang.NullPointerException at org.eclipse.jdt.ui.actions.FindOccurrencesInFileAction.run (FindOccurrencesInFileAction.java:157) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun (SelectionDispatchAction.java:222) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run (SelectionDispatchAction.java:198) at org.eclipse.jface.action.Action.runWithEvent(Action.java:996) ...
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/FindOccurrencesInFileAction.java
public void run(IStructuredSelection selection) {
		IMember member= getMember(selection);
		if (!ActionUtil.isProcessable(getShell(), member))
			return;
		FindOccurrencesEngine engine= FindOccurrencesEngine.create(member, new OccurrencesFinder());
		try {
			ISourceRange range= member.getNameRange();
			String result= engine.run(range.getOffset(), range.getLength());
			if (result != null)
				showMessage(getShell(), fActionBars, result);
		} catch (JavaModelException e) {
			JavaPlugin.log(e);
		}
	}
	
	private static void showMessage(Shell shell, IActionBars actionBars, String msg) {
		IStatusLineManager statusLine= actionBars.getStatusLineManager();
		if (statusLine != null)
			statusLine.setMessage(msg);
		shell.getDisplay().beep();
	}
	
	
	
	/* (non-JavaDoc)
	 * Method declared in SelectionDispatchAction.
	 */
	public void selectionChanged(ITextSelection selection) {
	}
	/* (non-JavaDoc)