--- a/langtools/src/share/classes/com/sun/tools/classfile/ClassWriter.java Tue May 19 11:33:13 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/ClassWriter.java Tue May 19 11:43:50 2009 -0700
@@ -118,13 +118,8 @@
ConstantPool pool = classFile.constant_pool;
int size = pool.size();
out.writeShort(size);
- try {
- for (int i = 1; i < size; ) {
- i += constantPoolWriter.write(pool.get(i), out);
- }
- } catch (ConstantPoolException e) {
- throw new Error(e); // ??
- }
+ for (CPInfo cpInfo: pool.entries())
+ constantPoolWriter.write(cpInfo, out);
}
protected void writeFields() throws IOException {