开发时用的jdk版本是1.6.0.45,在使用forEach循环对象的时候,报错 xxx cannot be xxxx
同事的JDK版本是1.6.0.43,居然没有问题。
for(Map m : billdtos){ System.out.println("22"); }
查看0.45版本编译后的class发现是这样的:
而正常的0.43版本编译后的class是这样的:
有没有发现不一样, 就像是
HashMap hashmap = new HashMap();
LinkedHashMap lmap = (LinkedHashMap) hashmap;