Bug 119860 - [evaluation] NPE from watch expression
Summary: [evaluation] NPE from watch expression
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 3.2.1   Edit
Assignee: Michael Rennie CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 105169 140637 151244 154656 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-12-08 08:48 EST by Darin Wright CLA
Modified: 2009-05-23 10:07 EDT (History)
6 users (show)

See Also:


Attachments
patch (1.64 KB, patch)
2006-06-07 16:48 EDT, Darin Wright CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Wright CLA 2005-12-08 08:48:18 EST
Added watch expression "fName.length()" and debugged junit.samples.VectorTest to breakpoint in testCapacity().

Got following NPE:

java.lang.NullPointerException
	at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTInstructionCompiler.containsALocalType(ASTInstructionCompiler.java:376)
	at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTInstructionCompiler.visit(ASTInstructionCompiler.java:2670)
	at org.eclipse.jdt.core.dom.MethodInvocation.accept0(MethodInvocation.java:236)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2497)
	at org.eclipse.jdt.core.dom.ReturnStatement.accept0(ReturnStatement.java:135)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2520)
	at org.eclipse.jdt.core.dom.Block.accept0(Block.java:135)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2497)
	at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:501)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2520)
	at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:483)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2520)
	at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:212)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450)
	at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine.createExpressionFromAST(ASTEvaluationEngine.java:389)
	at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine.getCompiledExpression(ASTEvaluationEngine.java:204)
	at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine.evaluate(ASTEvaluationEngine.java:89)
	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:2448)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Comment 1 Darin Wright CLA 2006-04-04 16:42:10 EDT
*** Bug 105169 has been marked as a duplicate of this bug. ***
Comment 2 Michael Rennie CLA 2006-04-17 15:30:39 EDT
for some reason the method binding being passed in is null....this one will take alot more effort and digging than allowed for the remainder or the RC's.
Comment 3 Darin Wright CLA 2006-04-17 22:17:44 EDT
I'll take a look at this one... I've got some ideas.
Comment 4 Darin Wright CLA 2006-04-26 18:41:38 EDT
Seems to be caused by the fact the fName is a private field access that is not visible from the receiving object that the expression is compiled in.
Comment 5 Darin Wright CLA 2006-05-02 14:31:14 EDT
Same problem existed in 3.1. Marking as later as this is not a regression. The best fix would be to propogate the compilation error to the user - i.e. fName is not visible. 
Comment 6 Darin Wright CLA 2006-05-08 15:05:55 EDT
*** Bug 140637 has been marked as a duplicate of this bug. ***
Comment 7 Darin Wright CLA 2006-05-08 15:06:12 EDT
Marking as 3.3
Comment 8 Darin Wright CLA 2006-05-31 17:10:01 EDT
Investigate for 3.2.1
Comment 9 Darin Wright CLA 2006-06-07 16:48:55 EDT
Created attachment 43794 [details]
patch

Patch reports the error to the user when unable to resolve a method binding.
Comment 10 Darin Wright CLA 2006-06-08 17:00:55 EDT
Released to TARGET_321 branch
Comment 11 Darin Wright CLA 2006-06-09 09:29:46 EDT
Released to HEAD
Comment 12 Darin Wright CLA 2006-07-06 11:46:45 EDT
Released to R3_2_maintenance branch
Comment 13 Darin Wright CLA 2006-07-06 11:46:58 EDT
Please verify, Mike.
Comment 14 Michael Rennie CLA 2006-07-06 12:40:08 EDT
verified
Comment 15 Darin Wright CLA 2006-07-27 16:19:34 EDT
*** Bug 151244 has been marked as a duplicate of this bug. ***
Comment 16 Darin Wright CLA 2006-08-28 11:37:38 EDT
*** Bug 154656 has been marked as a duplicate of this bug. ***
Comment 17 Ralf Hauser CLA 2009-05-23 10:07:13 EDT
see also Bug 277574