Bug 9271 - NPE inspecting "null" in the expressions view
Summary: NPE inspecting "null" in the expressions view
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 2.0 M4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-02-07 15:48 EST by Darin Swanson CLA
Modified: 2002-03-20 14:29 EST (History)
0 users

See Also:


Attachments
The dialog I got when I did Ctrl + Q (5.78 KB, image/gif)
2002-03-19 13:11 EST, Olivier Thomann CLA
no flags Details
The right dialog (5.33 KB, image/gif)
2002-03-19 13:13 EST, Olivier Thomann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Swanson CLA 2002-02-07 15:48:32 EST
20020205++

Type "null" into the expressions view details pane.
Select and hit Ctrl-Q

java.lang.NullPointerException
	at org.eclipse.jdt.internal.compiler.lookup.Scope.getType
(Scope.java:789)
	at 
org.eclipse.jdt.internal.eval.CodeSnippetCodeStream.generateObjectWrapperForType
(CodeSnippetCodeStream.java:216)
	at 
org.eclipse.jdt.internal.eval.CodeSnippetReturnStatement.generateStoreSaveValueI
fNecessary(CodeSnippetReturnStatement.java:66)
	at org.eclipse.jdt.internal.compiler.ast.ReturnStatement.generateCode
(ReturnStatement.java:140)
	at org.eclipse.jdt.internal.compiler.ast.Block.generateCode
(Block.java:60)
	at org.eclipse.jdt.internal.compiler.ast.TryStatement.generateCode
(TryStatement.java:196)
	at 
org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.generateCode
(AbstractMethodDeclaration.java:199)
	at 
org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.generateCode
(AbstractMethodDeclaration.java:148)
	at org.eclipse.jdt.internal.eval.CodeSnippetTypeDeclaration.generateCode
(CodeSnippetTypeDeclaration.java:52)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode
(TypeDeclaration.java:633)
	at 
org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.generateCode
(CompilationUnitDeclaration.java:129)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:530)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:332)
	at org.eclipse.jdt.internal.eval.Evaluator.getClasses
(Evaluator.java:113)
	at org.eclipse.jdt.internal.eval.EvaluationContext.evaluate
(EvaluationContext.java:213)
	at 
org.eclipse.jdt.internal.core.eval.EvaluationContextWrapper.evaluateCodeSnippet
(EvaluationContextWrapper.java:169)
	at org.eclipse.jdt.internal.debug.eval.LocalEvaluationEngine$2.run
(LocalEvaluationEngine.java:486)
	at java.lang.Thread.run(Thread.java:484)
Comment 1 Darin Wright CLA 2002-02-28 13:20:07 EST
Moving to JCORE
Comment 2 Olivier Thomann CLA 2002-03-19 13:09:57 EST
I cannot reproduce. Each time I try to Ctrl + Q, I got a dialog saying "Cannot perform nestes 
evaluation".
Please tell me how to reproduce it. I am using 0314.
Comment 3 Olivier Thomann CLA 2002-03-19 13:11:04 EST
Created attachment 490 [details]
The dialog I got when I did Ctrl + Q
Comment 4 Olivier Thomann CLA 2002-03-19 13:13:55 EST
Created attachment 491 [details]
The right dialog
Comment 5 Olivier Thomann CLA 2002-03-19 13:21:42 EST
Ok, this is fine. I could reproduce it in a self-hosting workspace. It should be quite simple to fix.
Comment 6 Olivier Thomann CLA 2002-03-19 13:48:51 EST
I guess we expect null to be returned.
The bug was due to the fact that null is considered as a base 
type. I am working on a fix.
Comment 7 Darin Swanson CLA 2002-03-19 15:26:23 EST
I would expect null to be returned...the user kindof treats null like a 
primitive.  If I display "1" I get back (int)1. So for "null" I would 
expect "null".
Comment 8 Olivier Thomann CLA 2002-03-19 15:58:48 EST
Fixed and released in HEAD.