use of jodd.asm5.MethodVisitor in project jodd by oblac.
the class MethodFinder method visitMethod.
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
if (paramExtractor != null) {
// method already found, skip all further methods
return null;
}
if (!name.equals(methodName)) {
// different method
return null;
}
Type[] argumentTypes = Type.getArgumentTypes(desc);
int dwordsCount = 0;
for (Type t : argumentTypes) {
if (t.getClassName().equals(TYPE_LONG) || t.getClassName().equals(TYPE_DOUBLE)) {
dwordsCount++;
}
}
int paramCount = argumentTypes.length;
if (paramCount != this.parameterTypes.length) {
// different number of params
return null;
}
for (int i = 0; i < argumentTypes.length; i++) {
if (!isEqualTypeName(argumentTypes[i], this.parameterTypes[i])) {
// wrong param types
return null;
}
}
this.paramExtractor = new ParamExtractor((Modifier.isStatic(access) ? 0 : 1), argumentTypes.length + dwordsCount);
return paramExtractor;
}
Aggregations