langtools/src/share/classes/com/sun/tools/classfile/ClassWriter.java
changeset 2978 a72220103e31
parent 727 cb50c1ae7bab
child 3149 0cd06d598d6f
--- 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 {