Community
Participate
Working Groups
---------------------------------------------------------------------------- package p; import java.util.Arrays; import java.util.Comparator; class A { void bar(Integer a[], int b[]) { Arrays.sort(a, new Comparator() { // ctrl+1 on this line @Override public int compare(Object object1, Object object2) { // TODO Auto-generated method stub return 0; } }); } } ---------------------------------------------------------------------------- - Place caret in "new Comparator()" OR Select "Type safety: The expression of type new Comparator(){} needs unchecked conversion to conform to Comparator<? super Integer>" in problems view - Crtl+1 - Select "Infer Generic type arguments" => the refactoring does not change anything The same can also be seen in org.eclipse.jdt.internal.ui.dialogs.TypeInfoViewer line 716, where the refactoring results in some changes but on other lines in the file.
Build id is I20110307-2110.
Unfortunately, it's very hard to find out when the Infer Generic Type Arguments refactoring will not be able to fix the problems, so I think we have to live with that. See bug 338404 for a solution tailored to this specific problem.