Prototype prototype(boolean includeThis) { return Prototype.intern(descriptor(includeThis)); }
private void addDependencies(DirectClassFile classFile) { for (Constant constant : classFile.getConstantPool().getEntries()) { if (constant instanceof CstType) { checkDescriptor(((CstType) constant).getClassType().getDescriptor()); } else if (constant instanceof CstFieldRef) { checkDescriptor(((CstFieldRef) constant).getType().getDescriptor()); } else if (constant instanceof CstBaseMethodRef) { checkPrototype(((CstBaseMethodRef) constant).getPrototype()); } } FieldList fields = classFile.getFields(); int nbField = fields.size(); for (int i = 0; i < nbField; i++) { checkDescriptor(fields.get(i).getDescriptor().getString()); } MethodList methods = classFile.getMethods(); int nbMethods = methods.size(); for (int i = 0; i < nbMethods; i++) { checkPrototype(Prototype.intern(methods.get(i).getDescriptor().getString())); } } private void checkPrototype(Prototype proto) {
Prototype prototype(boolean includeThis) { return Prototype.intern(descriptor(includeThis)); }
Prototype prototype(boolean includeThis) { return Prototype.intern(descriptor(includeThis)); }
Prototype prototype(boolean includeThis) { return Prototype.intern(descriptor(includeThis)); }
/** * Interns an instance which consists of the given number of * {@code int}s along with the given return type * * @param returnType {@code non-null;} the return type * @param count {@code > 0;} the number of elements in the prototype * @return {@code non-null;} the interned instance */ public static Prototype internInts(Type returnType, int count) { // Make the descriptor... StringBuffer sb = new StringBuffer(100); sb.append('('); for (int i = 0; i < count; i++) { sb.append('I'); } sb.append(')'); sb.append(returnType.getDescriptor()); // ...and intern it. return intern(sb.toString()); }
/** * Interns an instance which consists of the given number of * {@code int}s along with the given return type * * @param returnType {@code non-null;} the return type * @param count {@code > 0;} the number of elements in the prototype * @return {@code non-null;} the interned instance */ public static Prototype internInts(Type returnType, int count) { // Make the descriptor... StringBuffer sb = new StringBuffer(100); sb.append('('); for (int i = 0; i < count; i++) { sb.append('I'); } sb.append(')'); sb.append(returnType.getDescriptor()); // ...and intern it. return intern(sb.toString()); }
/** * Interns an instance which consists of the given number of * {@code int}s along with the given return type * * @param returnType {@code non-null;} the return type * @param count {@code > 0;} the number of elements in the prototype * @return {@code non-null;} the interned instance */ public static Prototype internInts(Type returnType, int count) { // Make the descriptor... StringBuffer sb = new StringBuffer(100); sb.append('('); for (int i = 0; i < count; i++) { sb.append('I'); } sb.append(')'); sb.append(returnType.getDescriptor()); // ...and intern it. return intern(sb.toString()); }
/** * Constructs an instance. * * @param definingClass {@code non-null;} the type of the defining class * @param nat {@code non-null;} the name-and-type */ /*package*/ CstBaseMethodRef(CstType definingClass, CstNat nat) { super(definingClass, nat); String descriptor = getNat().getDescriptor().getString(); this.prototype = Prototype.intern(descriptor); this.instancePrototype = null; }
/** * Constructs an instance. * * @param definingClass {@code non-null;} the type of the defining class * @param nat {@code non-null;} the name-and-type */ /*package*/ CstBaseMethodRef(CstType definingClass, CstNat nat) { super(definingClass, nat); String descriptor = getNat().getDescriptor().getString(); this.prototype = Prototype.intern(descriptor); this.instancePrototype = null; }
/** * Constructs an instance. * * @param definingClass {@code non-null;} the type of the defining class * @param nat {@code non-null;} the name-and-type */ /*package*/ CstBaseMethodRef(CstType definingClass, CstNat nat) { super(definingClass, nat); String descriptor = getNat().getDescriptor().getString(); this.prototype = Prototype.intern(descriptor); this.instancePrototype = null; }
/** * Constructs an instance. * * @param definingClass {@code non-null;} the type of the defining class * @param nat {@code non-null;} the name-and-type */ /*package*/ CstBaseMethodRef(CstType definingClass, CstNat nat) { super(definingClass, nat); String descriptor = getNat().getDescriptor().getString(); this.prototype = Prototype.intern(descriptor); this.instancePrototype = null; }
/** * Constructs an instance. * * @param definingClass {@code non-null;} the type of the defining class * @param nat {@code non-null;} the name-and-type */ /*package*/ CstBaseMethodRef(CstType definingClass, CstNat nat) { super(definingClass, nat); String descriptor = getNat().getDescriptor().getString(); this.prototype = Prototype.intern(descriptor); this.instancePrototype = null; }
/** * Constructs an instance. * * @param definingClass {@code non-null;} the type of the defining class * @param nat {@code non-null;} the name-and-type */ /*package*/ CstBaseMethodRef(CstType definingClass, CstNat nat) { super(definingClass, nat); String descriptor = getNat().getDescriptor().getString(); this.prototype = Prototype.intern(descriptor); this.instancePrototype = null; }
/** * Constructs an instance. * * @param definingClass {@code non-null;} the defining class * @param accessFlags access flags * @param nat {@code non-null;} member name and type (descriptor) * @param attributes {@code non-null;} list of associated attributes */ public StdMethod(CstType definingClass, int accessFlags, CstNat nat, AttributeList attributes) { super(definingClass, accessFlags, nat, attributes); String descStr = getDescriptor().getString(); effectiveDescriptor = Prototype.intern(descStr, definingClass.getClassType(), AccessFlags.isStatic(accessFlags), nat.isInstanceInit()); }
/** * Constructs an instance. * * @param definingClass {@code non-null;} the defining class * @param accessFlags access flags * @param nat {@code non-null;} member name and type (descriptor) * @param attributes {@code non-null;} list of associated attributes */ public StdMethod(CstType definingClass, int accessFlags, CstNat nat, AttributeList attributes) { super(definingClass, accessFlags, nat, attributes); String descStr = getDescriptor().getString(); effectiveDescriptor = Prototype.intern(descStr, definingClass.getClassType(), AccessFlags.isStatic(accessFlags), nat.isInstanceInit()); }
/** * Constructs an instance. * * @param definingClass {@code non-null;} the defining class * @param accessFlags access flags * @param nat {@code non-null;} member name and type (descriptor) * @param attributes {@code non-null;} list of associated attributes */ public StdMethod(CstType definingClass, int accessFlags, CstNat nat, AttributeList attributes) { super(definingClass, accessFlags, nat, attributes); String descStr = getDescriptor().getString(); effectiveDescriptor = Prototype.intern(descStr, definingClass.getClassType(), AccessFlags.isStatic(accessFlags), nat.isInstanceInit()); }
/** * Constructs an instance. * * @param definingClass {@code non-null;} the defining class * @param accessFlags access flags * @param nat {@code non-null;} member name and type (descriptor) * @param attributes {@code non-null;} list of associated attributes */ public StdMethod(CstType definingClass, int accessFlags, CstNat nat, AttributeList attributes) { super(definingClass, accessFlags, nat, attributes); String descStr = getDescriptor().getString(); effectiveDescriptor = Prototype.intern(descStr, definingClass.getClassType(), AccessFlags.isStatic(accessFlags), nat.isInstanceInit()); }
/** * Constructs an instance. * * @param definingClass {@code non-null;} the defining class * @param accessFlags access flags * @param nat {@code non-null;} member name and type (descriptor) * @param attributes {@code non-null;} list of associated attributes */ public StdMethod(CstType definingClass, int accessFlags, CstNat nat, AttributeList attributes) { super(definingClass, accessFlags, nat, attributes); String descStr = getDescriptor().getString(); effectiveDescriptor = Prototype.intern(descStr, definingClass.getClassType(), AccessFlags.isStatic(accessFlags), nat.isInstanceInit()); }
/** * Constructs an instance. * * @param definingClass {@code non-null;} the defining class * @param accessFlags access flags * @param nat {@code non-null;} member name and type (descriptor) * @param attributes {@code non-null;} list of associated attributes */ public StdMethod(CstType definingClass, int accessFlags, CstNat nat, AttributeList attributes) { super(definingClass, accessFlags, nat, attributes); String descStr = getDescriptor().getString(); effectiveDescriptor = Prototype.intern(descStr, definingClass.getClassType(), AccessFlags.isStatic(accessFlags), nat.isInstanceInit()); }