Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 96315

Summary: NPE in MethodExitsFinder during reconcile, checking for void type
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Markus Keller CLA 2005-05-23 11:46:36 EDT
N20050523-0010

- have CU p/A.java:
"package p;

public final class A {
	private static final Logger logger_= getLogger(A.class);

	public static void handleException(final Throwable t) {
		System.out.println(logger_);
	}

	private static Logger getLogger(Class name) {
		return null;
	}
}
"

- set caret into return type of method getLogger(..)

=> The inaccessible error dialog comes up and says:

Error 2005-05-23 17:39:46.886 An internal error occurred during: "Requesting
Java AST from selection".
java.lang.NullPointerException
	at org.eclipse.jdt.internal.corext.dom.Bindings.isVoidType(Bindings.java:1142)
	at
org.eclipse.jdt.internal.ui.search.MethodExitsFinder.markReferences(MethodExitsFinder.java:96)
	at
org.eclipse.jdt.internal.ui.search.MethodExitsFinder.perform(MethodExitsFinder.java:83)
	at
org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.updateOccurrenceAnnotations(JavaEditor.java:2896)
	at
org.eclipse.jdt.internal.ui.javaeditor.JavaEditor$6.selectionChanged(JavaEditor.java:2952)
	at
org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:173)
	at
org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$3.run(SelectionListenerWithASTManager.java:142)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:67)
Comment 1 Markus Keller CLA 2005-05-23 12:00:24 EDT
Easier example: With Mark Occurrences enabled, set caret into String2:

public class Try {
	String2 m() { return null; }
}
Comment 2 Dani Megert CLA 2005-05-23 12:16:11 EDT
Fixed in HEAD.
Comment 3 Tobias Widmer CLA 2005-05-27 10:03:15 EDT
Verified on I20050527-0010