public CtMethod getMethod(String name, String desc) throws NotFoundException { return getSuperclass().getMethod(name, desc); }
CtMethod superMethod = superCt.getMethod(intfMethod.getName(), intfMethod.getSignature()); if ((superMethod.getModifiers() & Modifier.ABSTRACT) != Modifier.ABSTRACT && !isDefaultMethod(intf, intfMethod)) { modifiedBody = modifiedBody.replace("((cast) ", "");
private CtMethod getCtMethod(Method m) throws NotFoundException { return getCtClass(m.getDeclaringClass()) .getMethod(m.getName(), ReflectUtils.getDescWithoutMethodName(m)); }
private CtMethod getCtMethod(Method m) throws NotFoundException { return getCtClass(m.getDeclaringClass()) .getMethod(m.getName(), ReflectUtils.getDescWithoutMethodName(m)); }
@Override public CtMethod getMethod(String name, String desc) throws NotFoundException { return getSuperclass().getMethod(name, desc); }
private boolean matchClass(String name, ClassPool pool) { if (classname.equals(name)) return true; try { CtClass clazz = pool.get(name); CtClass declClazz = pool.get(classname); if (clazz.subtypeOf(declClazz)) try { CtMethod m = clazz.getMethod(methodname, methodDescriptor); return m.getDeclaringClass().getName().equals(classname); } catch (NotFoundException e) { // maybe the original method has been removed. return true; } } catch (NotFoundException e) { return false; } return false; }
private CtMethod getCtMethod(Method m) throws NotFoundException { return getCtClass(m.getDeclaringClass()).getMethod(m.getName(), ReflectUtils.getDescWithoutMethodName(m)); }
private boolean matchClass(String name, ClassPool pool) { if (classname.equals(name)) return true; try { CtClass clazz = pool.get(name); CtClass declClazz = pool.get(classname); if (clazz.subtypeOf(declClazz)) try { CtMethod m = clazz.getMethod(methodname, methodDescriptor); return m.getDeclaringClass().getName().equals(classname); } catch (NotFoundException e) { // maybe the original method has been removed. return true; } } catch (NotFoundException e) { return false; } return false; }
/** * Returns the called method. */ public CtMethod getMethod() throws NotFoundException { return getCtClass().getMethod(getMethodName(), getSignature()); }
/** * Returns the called method. */ public CtMethod getMethod() throws NotFoundException { return getCtClass().getMethod(getMethodName(), getSignature()); }
public CtBehavior getEnclosingBehavior() throws NotFoundException { ClassFile cf = getClassFile2(); EnclosingMethodAttribute ema = (EnclosingMethodAttribute)cf.getAttribute( EnclosingMethodAttribute.tag); if (ema == null) return null; else { CtClass enc = classPool.get(ema.className()); String name = ema.methodName(); if (MethodInfo.nameInit.equals(name)) return enc.getConstructor(ema.methodDescriptor()); else if(MethodInfo.nameClinit.equals(name)) return enc.getClassInitializer(); else return enc.getMethod(name, ema.methodDescriptor()); } }
impl = cp.get(className); impl.defrost(); method_counter = impl.getMethod(METHOD_COUNTER, METHOD_SIGNATURE); } catch (NotFoundException e) { impl = cp.makeClass(className, cc);
impl = cp.get(className); impl.defrost(); method = impl.getMethod(URL, URL_SIG); } catch (NotFoundException e) { impl = cp.makeClass(className, cc);
impl = cp.get(className); impl.defrost(); method = impl.getMethod(CALL, CALL_SIG); } catch (NotFoundException e) { impl = cp.makeClass(className, cc);
@Override public CtBehavior getEnclosingBehavior() throws NotFoundException { ClassFile cf = getClassFile2(); EnclosingMethodAttribute ema = (EnclosingMethodAttribute)cf.getAttribute( EnclosingMethodAttribute.tag); if (ema == null) return null; CtClass enc = classPool.get(ema.className()); String name = ema.methodName(); if (MethodInfo.nameInit.equals(name)) return enc.getConstructor(ema.methodDescriptor()); else if(MethodInfo.nameClinit.equals(name)) return enc.getClassInitializer(); else return enc.getMethod(name, ema.methodDescriptor()); }
impl = cp.get(className); impl.defrost(); method = impl.getMethod(methodName, signature); } catch (javassist.NotFoundException e) { impl = cp.makeClass(className, cc);
impl = cp.get(name); impl.defrost(); method = impl.getMethod("process", "(" + nativeName(RealCounter.class) + ")V"); } catch (javassist.NotFoundException e) { impl = cp.makeClass(name, cc);