Bug 6243

Summary: an ISourceReference API issue
Product: [Eclipse Project] JDT Reporter: Adam Kiezun <akiezun>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2    
Version: 2.0   
Target Milestone: 2.0 M4   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

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