Community
Participate
Eclipse IDE
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) ...
Same if static initializer is selected in Outline view.
Backported this one to 3.1.1.
Start verifying...
Test on M20050804-1200 using the follwing test case: public class A { { System.out.println("Static initializer"); } void foo() { Collections.<B>emptySet(); } } The OccurencesInFile>>Identifier is now disabled which avoids the exception. Daniel, please let me know if this is not the expected behaviour.
It is the intended behavior.