Community
Participate
Working Groups
I20050202 (jdt-core from 20050207) - invoke content assist in the following locations (|) void method(List list) { Integer type= list.| int primitive= list.| } expected: proposals are ranked about the same in both locations actual: for the primitive, the List methods returning an int (indexOf, size, hashCode) are ranked high. For the Integer, the methods returning void (add...) are ranked the highest. I would support ranking autoboxing-proposals a little lower than direct matches, but autoboxing-proposals should still rank before the big mass (e.g. methods with a void return type).
*** Bug 271295 has been marked as a duplicate of this bug. ***
Though the defect title mentions only return value, in many other contexts also we should consider auto(un)boxing. For one example see bug #271295
Created attachment 132897 [details] Proposed patch This fix does a compatibility check for the left hand and right hand side type and if found compatible, uses R_EXPECTED_TYPE as the relevance value. Test cases are part of the patch.
Comment on attachment 132897 [details] Proposed patch Autoboxing is a 1.5 features, so the compatibility check should be done only if compliance is at least 1.5.
Created attachment 133082 [details] Latest patch Instead of calling the LookupEnvironment.computeBoxingType method, modified the fix to use Scope.isBoxingCompatibleWith, which already handles the compiler compatibility checks.
Comment on attachment 133082 [details] Latest patch This patch is good.
Released for 3.5M7.
Verified for 3.5M7 using I20090427-1800. I found a problem in relevance computation while verifying this bug. I entered bug 273991 for this problem.