/** * Returns the method {@link Type} corresponding to the given constructor. * * @param constructor a {@link Constructor} object. * @return the method {@link Type} corresponding to the given constructor. */ public static Type getType(final Constructor<?> constructor) { return getType(getConstructorDescriptor(constructor)); }
public MethodInfo(ClassInfo info, Constructor constructor) { super(constructor); this.declaringClass = info; this.name = "<init>"; this.descriptor = Type.getConstructorDescriptor(constructor); }
public String getNameWithDescriptor() { return "<init>" + org.objectweb.asm.Type.getConstructorDescriptor(constructor); }
public String getDescriptor() { return org.objectweb.asm.Type.getConstructorDescriptor(constructor); }
/** * Returns the method {@link Type} corresponding to the given constructor. * * @param constructor a {@link Constructor} object. * @return the method {@link Type} corresponding to the given constructor. */ public static Type getType(final Constructor<?> constructor) { return getType(getConstructorDescriptor(constructor)); }
/** * Returns the Java method type corresponding to the given constructor. * * @param c * a {@link Constructor Constructor} object. * @return the Java method type corresponding to the given constructor. */ public static Type getType(final Constructor<?> c) { return getType(getConstructorDescriptor(c)); }
/** * Returns the method {@link Type} corresponding to the given constructor. * * @param constructor a {@link Constructor} object. * @return the method {@link Type} corresponding to the given constructor. */ public static Type getType(final Constructor<?> constructor) { return getType(getConstructorDescriptor(constructor)); }
/** * Returns the Java method type corresponding to the given constructor. * * @param c * a {@link Constructor Constructor} object. * @return the Java method type corresponding to the given constructor. */ public static Type getType(final Constructor<?> c) { return getType(getConstructorDescriptor(c)); }
/** * Returns the method {@link Type} corresponding to the given constructor. * * @param constructor a {@link Constructor} object. * @return the method {@link Type} corresponding to the given constructor. */ public static Type getType(final Constructor<?> constructor) { return getType(getConstructorDescriptor(constructor)); }
public boolean testConstructorAccess(Constructor c, int mask) { String name = "<init>"; String desc = org.objectweb.asm.Type.getConstructorDescriptor(c); return (methodAccessTable.get(name+desc).intValue() & mask) != 0; }
private void writeObject(ObjectOutputStream oos) throws IOException { oos.defaultWriteObject(); // Write/save additional fields oos.writeObject(constructor.getDeclaringClass().getName()); oos.writeObject(org.objectweb.asm.Type.getConstructorDescriptor(constructor)); }
/** * Creates a new {@link Method}. * * @param constructor a java.lang.reflect constructor descriptor * @return a {@link Method} corresponding to the given Java constructor declaration. */ public static Method getMethod(final java.lang.reflect.Constructor<?> constructor) { return new Method("<init>", Type.getConstructorDescriptor(constructor)); }
/** * Creates a new {@link Method}. * * @param constructor a java.lang.reflect constructor descriptor * @return a {@link Method} corresponding to the given Java constructor declaration. */ public static Method getMethod(final java.lang.reflect.Constructor<?> constructor) { return new Method("<init>", Type.getConstructorDescriptor(constructor)); }
/** * Creates a new {@link Method}. * * @param constructor a java.lang.reflect constructor descriptor * @return a {@link Method} corresponding to the given Java constructor declaration. */ public static Method getMethod(final java.lang.reflect.Constructor<?> constructor) { return new Method("<init>", Type.getConstructorDescriptor(constructor)); }
/** * Creates a new {@link Method}. * * @param c * a java.lang.reflect constructor descriptor * @return a {@link Method} corresponding to the given Java constructor * declaration. */ public static Method getMethod(java.lang.reflect.Constructor<?> c) { return new Method("<init>", Type.getConstructorDescriptor(c)); }
protected static final String getDescriptor(Member m) { if (m instanceof Constructor) return Type.getConstructorDescriptor((Constructor) m); return Type.getMethodDescriptor((Method) m); }
@Override public String toString() { return constructor.getName() + Type.getConstructorDescriptor(constructor.getConstructor()); }
private void after(ConstructorStatement stmt, Scope scope) { String className = stmt.getConstructor().getDeclaringClass().getName(); String desc = Type.getConstructorDescriptor(stmt.getConstructor().getConstructor()); /* pops operands if previous code was not instrumented */ // constructor return type is always VOID String onwer = className.replace('.', '/'); VM.CALL_RESULT(onwer, INIT, desc); VariableReference varRef = stmt.getReturnValue(); ReferenceConstant nonNullRef = (ReferenceConstant) env.topFrame().operandStack.popRef(); String varName = varRef.getName(); symb_references.put(varName, nonNullRef); }
private void before(ConstructorStatement stmt, Scope scope) { String className = stmt.getConstructor().getDeclaringClass().getName(); VM.NEW(className); VM.DUP(); String desc = Type.getConstructorDescriptor(stmt.getConstructor().getConstructor()); pushParameterList(stmt.getParameterReferences(), scope, desc); String owner = className.replace('.', '/'); /* indicates if the following code is instrumented or not */ VM.INVOKESPECIAL(owner, INIT, desc); boolean needThis = true; call_vm_caller_stack_params(needThis, stmt.getParameterReferences(), scope, desc); }
public static String getMethodIdentifier(ExecutionResult result, int exceptionPosition){ if (result.test.getStatement(exceptionPosition) instanceof MethodStatement) { MethodStatement ms = (MethodStatement) result.test.getStatement(exceptionPosition); Method method = ms.getMethod().getMethod(); return method.getName() + Type.getMethodDescriptor(method); } else if (result.test.getStatement(exceptionPosition) instanceof ConstructorStatement) { ConstructorStatement cs = (ConstructorStatement) result.test.getStatement(exceptionPosition); Constructor<?> constructor = cs.getConstructor().getConstructor(); return "<init>" + Type.getConstructorDescriptor(constructor); } return ""; }