Duplicate :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
When compiling the following code, duplicate entries are created in the Constant Pool: Vector v = new Vector(); Iterator iter = v.iterator(); while (iter.hasNext()) { Object o = iter.next(); Object o2 = o; } for (Object o: v) { Object o2 = o; } From the constant pool (extracted by JRAW): ... cp4: Method #cp2 #cp29 // java.util.Vector.iterator () -> java.util.Iterator ... cp7: Method #cp2 #cp29 // java.util.Vector.iterator () -> java.util.Iterator ... Javac 1.5 beta, build-51 ###@###.### 2004-05-27 I just noticed this for a simple program with a try block: public class TT { public static void main(java.lang.String[] unused) { try { System.out.println("try"); } catch (Exception e) { System.out.println("catch"); } } }; class #25; // #5 class #25; // #16 Utf8 "java/lang/Exception"; // #25 While the duplicate constant pool entries might still be valid class file, this can't be good for download size.
|