6841419: classfile: add constant pool iterator

Reviewed-by: mcimadamore
This commit is contained in:
Jonathan Gibbons 2009-05-19 11:43:50 -07:00
parent 58eddef3f4
commit f05e74203e
3 changed files with 55 additions and 13 deletions

View file

@ -118,13 +118,8 @@ public class ClassWriter {
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 {