示例#1
0
 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);
 }
示例#2
0
 public void addFieldFirst(FieldNode node) {
   final ClassNode r = redirect();
   node.setDeclaringClass(r);
   node.setOwner(r);
   if (r.fields == null) r.fields = new LinkedList<FieldNode>();
   if (r.fieldIndex == null) r.fieldIndex = new HashMap<String, FieldNode>();
   r.fields.addFirst(node);
   r.fieldIndex.put(node.getName(), node);
 }
示例#3
0
 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));
 }