Bug 97550

Summary: [1.5][dom] NPE in BindingKeyResolver while displaying match in Search view
Product: [Eclipse Project] JDT Reporter: Frederic Fusier <frederic_fusier>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Frederic Fusier CLA 2005-05-31 11:56:31 EDT
Using 3.1 RC1.

1) Open a new workspace in self-hosting environment, create a new project and
set its JRE Library to 1.5.0.
2) Open Plug-ins view and add org.eclipse.debug.ui to Java Search path
3) Open java.util.List and hit Ctrl+Shift+G (search references in workspace).
4) Set a breakpoint on NullPointerException
5) When search is finished, click on button Show Next Match in Search view
=> debugger stop at NPE breakpoint in DefaultBindingresolver.resolveName(Name)
line 1032 as this.scope == null

The origin of this problem is that while creating ASTParser in
CompilationUnitResolver.convert(CompilationUnitDeclaration, ...) method,
compilationUnitDeclaration.scope is null and so DefaultBindingResolver is
initialized with a null argument for scope...

Note that this NPE does not appears in console as it's catched silently by
JDT/UI code...
Comment 1 Jerome Lanneluc CLA 2005-06-02 09:57:33 EDT
We actually behave nicely. We catch the NPE (in JDT Core code) and return null.
This is a case very similar to bug 53357.
No further action needed.