https://bugs.eclipse.org/bugs/show_bug.cgi?id=102599
javac accepts this illegal program:
import java.util.Map;
public class Test {
Object test() {
return (Map<String, String>)System.getProperties();
}
}
Comments
EVALUATION
A Properties object implements Map<Object,Object> which is not a
Map<String,String>. Other compilers already reject this program.
The program can be made to compile with a cast like this:
(Map)System.getProperties(). This is strongly discouraged as the cast
is incorrect and can cause problems later.