Community
Participate
Working Groups
Give a library that contains a class like: class DateUtil { static void clearTime(java.util.Date) { ... } static void clearTime(java.sql.Date) { ... } } An instance of BinaryMethod for clearTime(java.util.Date) will always return the source range for the java.sql.Date method from BinaryMethod.getSourceRange(). Within SourceMapper, there is no extra handling for a key that maps to multiple values: /** * Returns the <code>SourceRange</code> for the given element, or * {-1, -1} if no source range is known for the element. */ public SourceRange getSourceRange(IJavaElement element) { ... SourceRange[] ranges = (SourceRange[]) this.sourceRanges.get(element); if (ranges == null) { return UNKNOWN_RANGE; } else { return ranges[0]; // gets here with 2 items in the array } }
Bug 441489 shows what the Java editor does in this situation. In the Groovy editor, the specific method element can be unambiguously found, but SourceMapper cannot resolve the correct source range.
When computing hashCode() in BinaryMethod, the erased parameter types are incorporated. For both methods in the example, the param type is "QDate;", so the same hash code is produced.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
Eric, do you think this still applies?