Community
Participate
Working Groups
from bug 95785: N20050518-0010 (also with HEAD of JDT/UI and JDT/Core) - in the method below (in a 5.0 project), execute contant assist after toArray and choose "toArray(Object[] a)": public void test(java.util.List<Object> aList){ aList.toArray } - get these proposals: - toArray(T[]) T[] - Collection - toArray(T[]) T[] - List => Expected: only the one from List is proposed;
Reproduced in latest.
Created attachment 38932 [details] Proposed fix
Philippe - Do you want this fix for 3.2RC2 ? The problem is that the parameters binding of the methods 'toArray(T[]) are not the same. So to check if a method is already proposed my fix use 'lookupEnvironment.methodVerifier().doesMethodOverride(otherMethod, method)' instead of 'method.areParametersEqual(otherMethod)'.
Looks ok to me. I assume no perf degradation ? Kent - do you have an opinion ? +1 for 3.2RC2
perf degradation is smaller than 1% (to small to be really mesureable).
with 1.5, areParametersEqual is not very useful. So yes it looks fine
There is exactly the same problem with method declaration completion. class X extends List<Object> { toArray }
Created attachment 39173 [details] Better fix
Fix released and tests added. CompletionTest_1_5#test0286() -> test0287()
Verified with I20060427-1600 for RC2.