Bug 90902

Summary: NPE in default binding resolver
Product: [Eclipse Project] JDT Reporter: Dirk Baeumer <dirk_baeumer>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
My preferences none

Description Dirk Baeumer CLA 2005-04-09 12:20:45 EDT
I20050405-0800 ! JDT/Core & JDT/UI from HEAD

- opened OpenTypeSelectionDialog. The workspace has binary plug-ins imported
  from M5. 

Thread [Worker-1] (Suspended (exception NullPointerException))
	DefaultBindingResolver.resolveName(Name) line: 910
	SimpleName(Name).resolveBinding() line: 86
	SemanticToken.getBinding() line: 40
	SemanticHighlightings$StaticFieldHighlighting.consumes(SemanticToken) line: 261
	SemanticHighlightingReconciler$PositionCollector.visit(SimpleName) line: 79
	SimpleName.accept0(ASTVisitor) line: 147
	SimpleName(ASTNode).accept(ASTVisitor) line: 2450
	QualifiedName(ASTNode).acceptChild(ASTVisitor, ASTNode) line: 2497
	QualifiedName.accept0(ASTVisitor) line: 169
	QualifiedName(ASTNode).accept(ASTVisitor) line: 2450
	QualifiedName(ASTNode).acceptChild(ASTVisitor, ASTNode) line: 2497
	QualifiedName.accept0(ASTVisitor) line: 169
	QualifiedName(ASTNode).accept(ASTVisitor) line: 2450
	QualifiedName(ASTNode).acceptChild(ASTVisitor, ASTNode) line: 2497
	QualifiedName.accept0(ASTVisitor) line: 169
	QualifiedName(ASTNode).accept(ASTVisitor) line: 2450
	QualifiedName(ASTNode).acceptChild(ASTVisitor, ASTNode) line: 2497
	QualifiedName.accept0(ASTVisitor) line: 169
	QualifiedName(ASTNode).accept(ASTVisitor) line: 2450
	QualifiedName(ASTNode).acceptChild(ASTVisitor, ASTNode) line: 2497
	QualifiedName.accept0(ASTVisitor) line: 169
	QualifiedName(ASTNode).accept(ASTVisitor) line: 2450
	PackageDeclaration(ASTNode).acceptChild(ASTVisitor, ASTNode) line: 2497
	PackageDeclaration.accept0(ASTVisitor) line: 226
	PackageDeclaration(ASTNode).accept(ASTVisitor) line: 2450
	CompilationUnit(ASTNode).acceptChild(ASTVisitor, ASTNode) line: 2497
	CompilationUnit.accept0(ASTVisitor) line: 297
	CompilationUnit(ASTNode).accept(ASTVisitor) line: 2450
	SemanticHighlightingReconciler.reconcilePositions(ASTNode[]) line: 244
	SemanticHighlightingReconciler.reconciled(CompilationUnit, boolean,
IProgressMonitor) line: 203
	SemanticHighlightingReconciler$1.run(IProgressMonitor) line: 360
	Worker.run() line: 67
Comment 1 Philipe Mulet CLA 2005-04-09 15:16:52 EDT
Dirk - do you have precise steps to reproduce ?
Comment 2 Dirk Baeumer CLA 2005-04-11 05:56:11 EDT
What I did is the following:

- create new workspace and imported all plug-ins from M5a as binary plug-ins
- openen OpenTypeSelectionDialog using the Open Type dialog
Comment 3 Olivier Thomann CLA 2005-04-11 12:18:56 EDT
I could not reproduce.
I put a breakpoint on java.lang.NullPointerException and it was never hit.
Is it 100% reproducable for you?
Comment 4 Dirk Baeumer CLA 2005-04-12 04:06:46 EDT
I can still reproduce this in my test workspace.
Comment 5 Dirk Baeumer CLA 2005-04-12 04:12:49 EDT
The NPE happens because this.scope == null. 
The importReferences == "org.eclipse.jdt.internal.ui.dialogs.*"
Comment 6 Olivier Thomann CLA 2005-04-12 11:07:55 EDT
Could you please zip your workspace and put it somewhere I can get it? Thanks.
Comment 7 Olivier Thomann CLA 2005-04-12 13:19:53 EDT
I tried with linked binary folders and I could not reproduce.
I debugged and the scope is not null when the import references are resolved.

I used the default preferences. Could you have a specific preferences set that
could cause this issue?
Comment 8 Dirk Baeumer CLA 2005-04-12 13:42:20 EDT
Created attachment 19821 [details]
My preferences
Comment 9 Olivier Thomann CLA 2005-04-12 14:05:43 EDT
Could not reproduce even if I use your preferences.
I don't see how the scope can be null.
How did you get the stacktrace since this exception should have been ignored?
Comment 10 Olivier Thomann CLA 2005-04-12 15:23:33 EDT
Please try to reproduce without using linked projects. If you can reproduce,
please send me your workspace.
Comment 11 Dirk Baeumer CLA 2005-04-13 05:17:12 EDT
I got the stack trace since I catch all NPEs. 

I will give it a try with a full binary imported workspace. However, this may
take some time.
Comment 12 Olivier Thomann CLA 2005-04-13 09:31:48 EDT
I am leaving in vacations at the end of the week. So this is the last week to
see this fixed for M7.
Comment 13 Olivier Thomann CLA 2005-05-17 13:25:18 EDT
Dirk, did you get it lately?
If yes, please provide a test case. I could not reproduce it.
Comment 14 Dirk Baeumer CLA 2005-05-17 14:23:02 EDT
The OpenTypeSelectionDialog is gone now ;-). I haven't seen it since then. I
will reopen if I see it again. 
Comment 15 Olivier Thomann CLA 2005-05-17 14:26:26 EDT
Close as WORKSFORME.
Reopen if you get it again.