Community
Participate
Working Groups
HEAD The fix for bug 160520 has moved the error range for IProblem.IncompatibleReturnType from the method name and parameter list to the return type. This has caused failing UI tests, see bug 165913. Unfortunately, I still get the old-style error range for TypeMismatchQuickFixTests.testMismatchingReturnTypeOnGeneric2(): package test1; public class Base { public Number getVal() { return null; } } package test1; public class E<T> extends Base { public T getVal() { return null; } } Could you please select the full return type for all cases of IProblem.IncompatibleReturnType?
(In reply to comment #0) > Unfortunately, I still get the old-style error range for Oops, I guess I messed something up here. Im not getting the old-style error range, but a range that does not include type arguments. E.g. here, the source range only covers "E", not "E<T>": public class E<T> extends Base { public E<T> getVal() { ...
In fact we have other errors on parameterized type reference where the type arguments are not part of the problem's range. So I can fix this one, but we might want to fix all of them.
In this very case, selecting the entire parameterized type makes sense. I'd like to see the other ones you are referring to Olivier. It depends where the blame is: e.g. when complaining about "Object<String>" to be invalid since Object is not generic, then I would only expect "Object" to be selected.
To be pragmatic, I would address this one issue, and investigate others in subsequent bugs (if proven to be an issue).
Added bug 166004 and bug 166005 to give specific test cases for comment 2.
Released for 3.3M4. Updated existing regression tests: org.eclipse.jdt.core.tests.compiler.regression.GenericTypeTest#test0059/test0384/test0385 org.eclipse.jdt.core.tests.compiler.regression.MethodVerifyTest#test081
Verified for 3.3M4 with I20061212-0010.