Bug 48701 - NPE evaluating watch expression
Summary: NPE evaluating watch expression
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: 3.0 M7   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-13 23:14 EST by Jared Burns CLA
Modified: 2004-02-11 09:18 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jared Burns CLA 2003-12-13 23:14:59 EST
While doing some standard selfhosting debugging, the following NPE was dumped to 
the console. I had just finished stepping to WorkbenchHelp$2.
helpRequest(HelpEvent) line 420 and I had an expression which read fWidthText.
getText().trim() left over from a previous debug session.

java.lang.NullPointerException
	at org.eclipse.jdt.core.dom.MethodBinding.getKey(MethodBinding.java:170)
	at org.eclipse.jdt.core.dom.DefaultBindingResolver.
resolveMethod(DefaultBindingResolver.java:401)
	at org.eclipse.jdt.core.dom.MethodDeclaration.
resolveBinding(MethodDeclaration.java:435)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:723)
	at org.eclipse.jdt.core.dom.ASTConverter.
buildBodyDeclarations(ASTConverter.java:917)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1059)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:740)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1752)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:673)
	at org.eclipse.jdt.core.dom.ASTConverter.
buildBodyDeclarations(ASTConverter.java:243)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:182)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:80)
	at org.eclipse.jdt.core.dom.AST.parseCompilationUnit(AST.java:768)
	at org.eclipse.jdt.core.dom.AST.parseCompilationUnit(AST.java:650)
	at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine.
getCompiledExpression(ASTEvaluationEngine.java:148)
	at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine.
evaluate(ASTEvaluationEngine.java:72)
	at org.eclipse.jdt.internal.debug.ui.
JavaWatchExpressionDelegate$EvaluationRunnable.run(JavaWatchExpressionDelegate.
java:144)
	at org.eclipse.jdt.internal.debug.core.model.JDIThread$ThreadJob.
run(JDIThread.java:2497)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:62)
Comment 1 Olivier Thomann CLA 2004-01-05 09:06:39 EST
Do you remember if you had some compilation errors in your workspace?
Comment 2 Jared Burns CLA 2004-01-05 11:50:02 EST
I don't recall. I'd say it's not likely, though.
Comment 3 Olivier Thomann CLA 2004-01-05 12:28:54 EST
The only way you can get a NPE is in the case of a problem binding. This means
that you had some kind of errors in your code.
I will continue to investigate.
Comment 4 Olivier Thomann CLA 2004-01-08 16:38:48 EST
Added extra null checks.
Please provide a test case if you get it again.
Fixed and released in HEAD.
Comment 5 Frederic Fusier CLA 2004-02-11 09:18:45 EST
Verified for 3.0-M7 with build I200402102000.