Bug 6243 - an ISourceReference API issue
Summary: an ISourceReference API issue
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: 2.0 M4   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-23 04:52 EST by Adam Kiezun CLA
Modified: 2002-03-14 13:00 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-11-23 04:52:43 EST
ISourceReference is not an IJavaElement and has no exists() method
however, its 2 methods throw JavaModelException and according to the java doc
it's thrown when the element does not exist.

how then, am i to check that the element does not exist and avoid the exception?
well, all ISourceReference known to man are actually IJavaElements 
but hardcast is a nasty thing and i'd like to avoid it here.

suggestion: can an exists() method be added to ISourceReference 
or ISourceReference be made a subtype of IJavaElement?
i need a clean way to prevent the exception - rather than having to deal with 
it.
Comment 1 Philipe Mulet CLA 2002-03-14 13:00:58 EST
Added #exists() onto ISourceReference.
Fixed