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

2 comments

I hate to say it but this is IDEA bug.

0

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

Please sign in to leave a comment.