I have an interface in Java 6 that compiles correctly:
public interface IMultiMap extends Map> {
public int valueSize(
I think it's a bug in 1.6 that was fixed in 1.7. Extract from this page:
Synopsis: A Class Cannot Define Two Methods with the Same Erased Signature but Two Different Return Types
Description: A class cannot define two methods with the same erased signature, regardless of whether the return types are the same or not. This follows from the JLS, Java SE 7 Edition, section 8.4.8.3. The JDK 6 compiler allows methods with the same erased signature but different return types; this behavior is incorrect and has been fixed in JDK 7.
Example:
class A {
int m(List ls) { return 0; }
long m(List ls) { return 1; }
}
This code compiles under JDK 5.0 and JDK 6, and is rejected under JDK 7.