Bug 102494 - [navigation] NPE finding occurences of static initializer
Summary: [navigation] NPE finding occurences of static initializer
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1.1   Edit
Assignee: JDT-Text-Inbox CLA Friend
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-01 11:38 EDT by Brian Miller CLA Friend
Modified: 2005-08-09 06:19 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Miller CLA Friend 2005-07-01 11:38:53 EDT
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)
        ...
Comment 1 Dani Megert CLA Friend 2005-07-04 06:40:48 EDT
Same if static initializer is selected in Outline view.

Comment 2 Dani Megert CLA Friend 2005-07-05 05:47:45 EDT
Backported this one to 3.1.1.
Comment 3 Dirk Baeumer CLA Friend 2005-08-09 06:06:41 EDT
Start verifying...
Comment 4 Dirk Baeumer CLA Friend 2005-08-09 06:09:55 EDT
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.
Comment 5 Dani Megert CLA Friend 2005-08-09 06:19:52 EDT
It is the intended behavior.