Bug 39925 - Unnecessary instanceof checking leads to a NullPointerException
Summary: Unnecessary instanceof checking leads to a NullPointerException
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M2   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-11 09:27 EDT by Olivier Thomann CLA
Modified: 2003-07-16 06:31 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2003-07-11 09:27:15 EDT
Using latest HEAD contents (0709+), compiling the following test case leads to:
1. ERROR in d:\temp\A.java (at line 0)
	class A {
	^
Internal compiler error
java.lang.NullPointerException
	at
org.eclipse.jdt.internal.compiler.problem.ProblemReporter.unnecessaryInstanceof(ProblemReporter.java:2927)
	at
org.eclipse.jdt.internal.compiler.ast.InstanceOfExpression.resolveType(InstanceOfExpression.java:209)
	at
org.eclipse.jdt.internal.compiler.ast.FieldDeclaration.resolve(FieldDeclaration.java:193)
	at
org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:830)
	at
org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:887)
	at
org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:270)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:533)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:328)
	at org.eclipse.jdt.internal.compiler.batch.Main.performCompilation(Main.java:1459)
	at org.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:304)
	at org.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:199)
	at org.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:191)
	at org.eclipse.jdt.core.tools.compiler.Compile.main(Compile.java:8)

class A {
	boolean b = new Cloneable() {} instanceof Cloneable;
}
Comment 1 Philipe Mulet CLA 2003-07-11 10:44:31 EDT
Qualified allocation did not position its resolvedType slot as it should.
Comment 2 Philipe Mulet CLA 2003-07-11 10:44:42 EDT
Fixed
Comment 3 David Audel CLA 2003-07-16 06:31:19 EDT
Verified.