Community
Participate
Working Groups
FUP of bug 150980. See bug 150980 comment 15.
Due to some inconsistencies between API, I cannot factorize this one without breaking existing clients. Some definition of getNameRange() is throwing a JavaModelException and some don't. So I think we are stuck with what we have right now since the JavaModelException is a checked exception, removing the throw clause would break the source compatibility for clients that are calling it since the exception could not be thrown anymore and therefore the corresponding try/catch could never be reached. If I add it for the one that didn't have it, this is a source breaking change since clients would not have a try/catch around the corresponding call. The guilty one is the definition in org.eclipse.jdt.core.ILocalVariable. Should I close it as WONTFIX or you want to introduce a known breakage into the API ?
Created attachment 177877 [details] Proposed fix This preserves the definition on ILocalVariable and factorize all other definitions on ISourceReference. Markus, let me know what you think.
Looks mostly good. I didn't verify the whole Javadoc of ISourceReference#getNameRange(), but I assume you just copy-pasted it. The @return tag should mention null, e.g.: * @return the name range associated with this element, or <code>null</code> if not available
Created attachment 177879 [details] Proposed fix Updated patch.
Released for 3.7M2. Verification must be done by code inspection.
Adopted the new API at two places in JDT Text.
Verified for 3.7M2 via code inspection