public void removeField(String oldName) { ClassNode r = redirect(); if (r.fieldIndex == null) r.fieldIndex = new HashMap<String, FieldNode>(); final Map<String, FieldNode> index = r.fieldIndex; r.fields.remove(index.get(oldName)); index.remove(oldName); }
public void renameField(String oldName, String newName) { ClassNode r = redirect(); if (r.fieldIndex == null) r.fieldIndex = new HashMap<String, FieldNode>(); final Map<String, FieldNode> index = r.fieldIndex; index.put(newName, index.remove(oldName)); }