Bug 5355

Summary: search: NPE in searchDeclarationsOfReferencedTypes
Product: [Eclipse Project] JDT Reporter: Adam Kiezun <akiezun>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.0 M3   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Adam Kiezun CLA 2001-10-30 09:32:14 EST
i have a pointer to IMethod in hand
(this method happens to be declared in a working copy)
when i search using SearchEngine::searchDeclarationsOfReferencedTypes
i get an NPE because underlyingResource does not exist for this method

i'd expect the search engine to be smart enough to convert the method to one 
that is declared in a real compilation unit and work on that one.
Comment 1 Philipe Mulet CLA 2002-02-02 07:33:40 EST
The SearchEngine should not fix up handles that are passed to it. In case of 
inaccurate search, then you should use the string based API (i.e. no wildcards 
with Java elements).

Now we should not raise a NPE in this case. 
Jerome, can you please check our behavior in latest ? If ok, then close this 
defect.
Comment 2 Jerome Lanneluc CLA 2002-02-03 16:48:22 EST
There is no NPE any longer, but we find no matches. Need to fix.
Comment 3 Jerome Lanneluc CLA 2002-02-04 07:19:39 EST
If the enclosing element is contained in a working copy, this working copy now 
takes precence over the original compilation unit.