Bug 5355 - search: NPE in searchDeclarationsOfReferencedTypes
Summary: search: NPE in searchDeclarationsOfReferencedTypes
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M3   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-30 09:32 EST by Adam Kiezun CLA
Modified: 2002-02-06 07:54 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.