Community
Participate
Working Groups
I20060301-0800 Several queries of the JavaModel return an ISourceRange with [offset=-1, length=0] when sources are not available (IMember#getSourceRange(), ISourceReference#getSourceRange(), but not IMember#getJavadocRange()). But the javadocs of these methods say that they will return null if sources are not available. And ISourceRange#getOffset() says it returns the 0-based offset, so -1 cannot be correct. I'm pretty sure many clients would be broken if the implementation was just fixed now, so I guess either this change should be announced, or the javadoc should be adapted to the reality.
Spec would need to say that both (null and [-1, 0] should be expected to not break existing clients.
I just found a reference to duplicate bug 18311 in our code.
One of us just fell over this again and forgot to use our internal helper org.eclipse.jdt.internal.corext.SourceRange.isAvailable(ISourceRange).
*** Bug 156688 has been marked as a duplicate of this bug. ***
Marking as a dup of the oldest bug *** This bug has been marked as a duplicate of bug 18311 ***
Verified for 3.4M1 using build I20070802-0800.