Community
Participate
Working Groups
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.
Added #exists() onto ISourceReference. Fixed