Generics problem or my misunderstanding

We have following code (simplified example):

public static void foo(List foos) { final Comparator comparator = createComparator(); Collections.sort(foos, comparator); } private static Comparator]]> createComparator() {
return ...;
}

public interface Foo {
}

IDEA 4188 highlights the method call Collections.sort in red, where as the compiler does not show an error. Who is right?

Tom

0
Avatar
Permanently deleted user

I hate to say it but this is IDEA bug.

0
Avatar
Permanently deleted user

Thanks Eugene, I wasn't sure whether it's a IDEA or compiler bug or my own misunderstanding. I've added a JIRA issue.

0

请先登录再写评论。