/** * Returns the name of the field. */ public String getName() { return fieldInfo.getName(); }
/** * Returns the name of the field. */ @Override public String getName() { return fieldInfo.getName(); }
public String getFieldName(final FieldInfo field) { return field.getName(); }
public String getFieldName(final FieldInfo field) { return field.getName(); }
private void testExistingField(String name, String descriptor) throws DuplicateMemberException { ListIterator it = fields.listIterator(0); while (it.hasNext()) { FieldInfo minfo = (FieldInfo)it.next(); if (minfo.getName().equals(name)) throw new DuplicateMemberException("duplicate field: " + name); } }
/** * Returns a string representation of the object. */ public String toString() { return getName() + " " + getDescriptor(); }
/** * Returns a string representation of the object. */ @Override public String toString() { return getName() + " " + getDescriptor(); }
private void testExistingField(String name, String descriptor) throws DuplicateMemberException { for (FieldInfo minfo:fields) if (minfo.getName().equals(name)) throw new DuplicateMemberException("duplicate field: " + name); }
/** * Appends a field to the class. * * @throws DuplicateMemberException when the field is already included. */ public void addField(FieldInfo finfo) throws DuplicateMemberException { testExistingField(finfo.getName(), finfo.getDescriptor()); fields.add(finfo); }
/** * Appends a field to the class. * * @throws DuplicateMemberException when the field is already included. */ public void addField(FieldInfo finfo) throws DuplicateMemberException { testExistingField(finfo.getName(), finfo.getDescriptor()); fields.add(finfo); }
private int addFieldrefInfo(CtField f, FieldInfo finfo) { ConstPool cp = bytecode.getConstPool(); String cname = f.getDeclaringClass().getName(); int ci = cp.addClassInfo(cname); String name = finfo.getName(); String type = finfo.getDescriptor(); return cp.addFieldrefInfo(ci, name, type); }
/** * Copies all constant pool items to a given new constant pool * and replaces the original items with the new ones. * This is used for garbage collecting the items of removed fields * and methods. * * @param cp the destination */ void compact(ConstPool cp) { name = cp.addUtf8Info(getName()); descriptor = cp.addUtf8Info(getDescriptor()); attribute = AttributeInfo.copyAll(attribute, cp); constPool = cp; }
private int addFieldrefInfo(CtField f, FieldInfo finfo) { ConstPool cp = bytecode.getConstPool(); String cname = f.getDeclaringClass().getName(); int ci = cp.addClassInfo(cname); String name = finfo.getName(); String type = finfo.getDescriptor(); return cp.addFieldrefInfo(ci, name, type); }
throws CannotCompileException this(src.fieldInfo.getDescriptor(), src.fieldInfo.getName(), declaring); java.util.ListIterator iterator
/** * Copies all constant pool items to a given new constant pool * and replaces the original items with the new ones. * This is used for garbage collecting the items of removed fields * and methods. * * @param cp the destination */ void compact(ConstPool cp) { name = cp.addUtf8Info(getName()); descriptor = cp.addUtf8Info(getDescriptor()); attribute = AttributeInfo.copyAll(attribute, cp); constPool = cp; }
for (int i = 0; i < n; i++) { FieldInfo finfo = (FieldInfo)list.get(i); table.put(finfo.getName(), this);
int acc = finfo.getAccessFlags(); out.println(Modifier.toString(AccessFlag.toModifier(acc)) + " " + finfo.getName() + "\t" + finfo.getDescriptor()); printAttributes(finfo.getAttributes(), out, 'f');
name = cp.addUtf8Info(getName()); descriptor = cp.addUtf8Info(getDescriptor()); constPool = cp;
String fieldName = finfo.getName(); if ((finfo.getAccessFlags() & AccessFlag.STATIC) == 0) { code.addAload(0);
String fieldName = finfo.getName(); if ((finfo.getAccessFlags() & AccessFlag.STATIC) == 0) { code.addAload(0);