/** * @return deep copy of this constant pool */ public ConstantPool copy() { ConstantPool c = null; try { c = (ConstantPool)clone(); } catch(CloneNotSupportedException e) {} c.constant_pool = new Constant[constant_pool_count]; for(int i=1; i < constant_pool_count; i++) { if(constant_pool[i] != null) c.constant_pool[i] = constant_pool[i].copy(); } return c; } }
/** * @return deep copy of this constant pool */ public ConstantPool copy() { ConstantPool c = null; try { c = (ConstantPool) clone(); c.constant_pool = new Constant[constant_pool.length]; for (int i = 1; i < constant_pool.length; i++) { if (constant_pool[i] != null) { c.constant_pool[i] = constant_pool[i].copy(); } } } catch (final CloneNotSupportedException e) { // TODO should this throw? } return c; } }