Community
Participate
Working Groups
From bug 174327: We have no good quick fix for the situation below. import java.util.Collections; import java.util.Map; public class Try { void caller() { method(Collections.emptyMap()); //error on method } void method(Map<String, Integer> map) { } } The user probably meant: method(Collections.<String, Integer>emptyMap()); The compiler do the inference when Collections.emptyMap() is assigned to a variable (JLS3 15.12.2.8), but not when it is the actual argument of a method invocation.
*** This bug has been marked as a duplicate of bug 174329 ***