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) {
/** * Gets the number of words of parameters required by this * method's descriptor. Since instances of this class have no way * to know if they will be used in a {@code static} or * instance context, one has to indicate this explicitly as an * argument. This method is just a convenient shorthand for * {@code getPrototype().getParameterTypes().getWordCount()}, * plus {@code 1} if the method is to be treated as an * instance method. * * @param isStatic whether the method should be considered static * @return {@code >= 0;} the argument word count */ public final int getParameterWordCount(boolean isStatic) { return getPrototype(isStatic).getParameterTypes().getWordCount(); }
/** * Gets the number of words of parameters required by this * method's descriptor. Since instances of this class have no way * to know if they will be used in a {@code static} or * instance context, one has to indicate this explicitly as an * argument. This method is just a convenient shorthand for * {@code getPrototype().getParameterTypes().getWordCount()}, * plus {@code 1} if the method is to be treated as an * instance method. * * @param isStatic whether the method should be considered static * @return {@code >= 0;} the argument word count */ public final int getParameterWordCount(boolean isStatic) { return getPrototype(isStatic).getParameterTypes().getWordCount(); }
/** * Gets the number of words of parameters required by this * method's descriptor. Since instances of this class have no way * to know if they will be used in a {@code static} or * instance context, one has to indicate this explicitly as an * argument. This method is just a convenient shorthand for * {@code getPrototype().getParameterTypes().getWordCount()}, * plus {@code 1} if the method is to be treated as an * instance method. * * @param isStatic whether the method should be considered static * @return {@code >= 0;} the argument word count */ public final int getParameterWordCount(boolean isStatic) { return getPrototype(isStatic).getParameterTypes().getWordCount(); }
/** {@inheritDoc} */ @Override protected int getTypoidIdx(DexFile file) { ProtoIdsSection protoIds = file.getProtoIds(); return protoIds.indexOf(getMethodRef().getPrototype()); }
/** {@inheritDoc} */ @Override protected int getTypoidIdx(DexFile file) { ProtoIdsSection protoIds = file.getProtoIds(); return protoIds.indexOf(getMethodRef().getPrototype()); }
/** {@inheritDoc} */ @Override protected int getTypoidIdx(DexFile file) { ProtoIdsSection protoIds = file.getProtoIds(); return protoIds.indexOf(getMethodRef().getPrototype()); }
/** {@inheritDoc} */ @Override protected int getTypoidIdx(DexFile file) { ProtoIdsSection protoIds = file.getProtoIds(); return protoIds.indexOf(getMethodRef().getPrototype()); }
/** {@inheritDoc} */ @Override protected int getTypoidIdx(DexFile file) { ProtoIdsSection protoIds = file.getProtoIds(); return protoIds.indexOf(getMethodRef().getPrototype()); }
/** {@inheritDoc} */ @Override protected int getTypoidIdx(DexFile file) { ProtoIdsSection protoIds = file.getProtoIds(); return protoIds.indexOf(getMethodRef().getPrototype()); }
/** {@inheritDoc} */ @Override protected int getTypoidIdx(DexFile file) { ProtoIdsSection protoIds = file.getProtoIds(); return protoIds.indexOf(getMethodRef().getPrototype()); }
/** {@inheritDoc} */ @Override protected int getTypoidIdx(DexFile file) { ProtoIdsSection protoIds = file.getProtoIds(); return protoIds.indexOf(getMethodRef().getPrototype()); }
/** {@inheritDoc} */ @Override public void addContents(DexFile file) { super.addContents(file); ProtoIdsSection protoIds = file.getProtoIds(); protoIds.intern(getMethodRef().getPrototype()); }
/** {@inheritDoc} */ @Override public void addContents(DexFile file) { super.addContents(file); ProtoIdsSection protoIds = file.getProtoIds(); protoIds.intern(getMethodRef().getPrototype()); }
/** {@inheritDoc} */ @Override public void addContents(DexFile file) { super.addContents(file); ProtoIdsSection protoIds = file.getProtoIds(); protoIds.intern(getMethodRef().getPrototype()); }
/** {@inheritDoc} */ @Override public void addContents(DexFile file) { super.addContents(file); ProtoIdsSection protoIds = file.getProtoIds(); protoIds.intern(getMethodRef().getPrototype()); }
/** {@inheritDoc} */ @Override public void addContents(DexFile file) { super.addContents(file); ProtoIdsSection protoIds = file.getProtoIds(); protoIds.intern(getMethodRef().getPrototype()); }
/** {@inheritDoc} */ @Override public void addContents(DexFile file) { super.addContents(file); ProtoIdsSection protoIds = file.getProtoIds(); protoIds.intern(getMethodRef().getPrototype()); }
/** {@inheritDoc} */ @Override public void addContents(DexFile file) { super.addContents(file); ProtoIdsSection protoIds = file.getProtoIds(); protoIds.intern(getMethodRef().getPrototype()); }
/** {@inheritDoc} */ @Override public void addContents(DexFile file) { super.addContents(file); ProtoIdsSection protoIds = file.getProtoIds(); protoIds.intern(getMethodRef().getPrototype()); }