Bug 9271

Summary: NPE inspecting "null" in the expressions view
Product: [Eclipse Project] JDT Reporter: Darin Swanson <Darin_Swanson>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.0 M4   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
The dialog I got when I did Ctrl + Q
none
The right dialog none

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.