private CtMethod findOriginal(CtMethod m, boolean dontSearch) throws NotFoundException { if (dontSearch) return m; String name = m.getName(); CtMethod[] ms = m.getDeclaringClass().getDeclaredMethods(); for (int i = 0; i < ms.length; ++i) { String orgName = ms[i].getName(); if (orgName.endsWith(name) && orgName.startsWith(ClassMetaobject.methodPrefix) && ms[i].getSignature().equals(m.getSignature())) return ms[i]; } return m; }
/** * Returns the method name followed by parameter types * such as <code>javassist.CtMethod.setBody(String)</code>. * * @since 3.5 */ public String getLongName() { return getDeclaringClass().getName() + "." + getName() + Descriptor.toString(getSignature()); }
private CtMethod findOriginal(CtMethod m, boolean dontSearch) throws NotFoundException { if (dontSearch) return m; String name = m.getName(); CtMethod[] ms = m.getDeclaringClass().getDeclaredMethods(); for (int i = 0; i < ms.length; ++i) { String orgName = ms[i].getName(); if (orgName.endsWith(name) && orgName.startsWith(ClassMetaobject.methodPrefix) && ms[i].getSignature().equals(m.getSignature())) return ms[i]; } return m; }
protected String methodDescription(CtMethod method) { return method.getDeclaringClass().getName() + "|" + method.getName() + "|" + method.getSignature(); }
private String getMethodString(CtMethod method) { try { return Modifier.toString(method.getModifiers()) + " " + method.getReturnType().getName() + " " + method.getName() + Descriptor.toString(method.getSignature()) + ";"; } catch (NotFoundException e) { throw new RuntimeException(e); } }
protected String methodDescription(CtMethod method) { return method.getDeclaringClass().getName() + "|" + method.getName() + "|" + method.getSignature(); }
/** * Returns the method name followed by parameter types * such as <code>javassist.CtMethod.setBody(String)</code>. * * @since 3.5 */ @Override public String getLongName() { return getDeclaringClass().getName() + "." + getName() + Descriptor.toString(getSignature()); }
public static int addMethod(ConstPool cPool, CtMethod method) { return cPool.addMethodrefInfo( cPool.getThisClassInfo(), method.getName(), method.getSignature() ); }
private String getMethodString(CtMethod method) { try { return Modifier.toString(method.getModifiers()) + " " + method.getReturnType().getName() + " " + method.getName() + Descriptor.toString(method.getSignature()) + ";"; } catch (NotFoundException e) { throw new RuntimeException(e); } }
for (CtMethod ctMethod : invokeSuperMethodList) { if ((ctMethod.getName().replaceAll("\\.", "/") + ctMethod.getSignature().subSequence(0, ctMethod.getSignature().indexOf(")") + 1)).equals(getMethodSignureInSmaliLine(line))) { result = line.replace(Constants.SMALI_INVOKE_VIRTUAL_COMMAND, Constants.SMALI_INVOKE_SUPER_COMMAND); try {
for (CtMethod method : superCt.getMethods()) { if ((method.getModifiers() & Modifier.FINAL) == Modifier.FINAL) { superSigs.add(method.getName() + method.getSignature()); targetCt.addInterface(intfCt); for (CtMethod intfMethod : intfCt.getDeclaredMethods()) { final String signature = intfMethod.getName() + intfMethod.getSignature(); CtMethod superMethod = superCt.getMethod(intfMethod.getName(), intfMethod.getSignature()); if ((superMethod.getModifiers() & Modifier.ABSTRACT) != Modifier.ABSTRACT && !isDefaultMethod(intf, intfMethod)) { modifiedBody = modifiedBody.replace("((cast) ", "");
/** * Create a unique key for store the CtMethod object in an Map object. * @param CtMethod to store in the Map * @return a String key unique for the method. */ private static String getMethodKey(CtMethod method) { String ret=method.getName() + method.getSignature(); return ret; } }
private static boolean hasMethod(final CtClass theClass, final CtMethod theMethod) { try { return theClass.getMethod(theMethod.getName(), theMethod.getSignature()) != null; } catch (NotFoundException e) { return false; } }
/** * Returns the method name followed by parameter types * such as <code>javassist.CtMethod.setBody(String)</code>. * * @since 3.5 */ public String getLongName() { return getDeclaringClass().getName() + "." + getName() + Descriptor.toString(getSignature()); }
/** * Returns the method name followed by parameter types * such as <code>javassist.CtMethod.setBody(String)</code>. * * @since 3.5 */ public String getLongName() { return getDeclaringClass().getName() + "." + getName() + Descriptor.toString(getSignature()); }
/** * Returns the method name followed by parameter types * such as <code>javassist.CtMethod.setBody(String)</code>. * * @since 3.5 */ public String getLongName() { return getDeclaringClass().getName() + "." + getName() + Descriptor.toString(getSignature()); }
private String computeReturnType(CtMethod oldMethod) { MethodDescriptorParser parser = new MethodDescriptorParser(); parser.parse(oldMethod.getSignature()); return parser.getReturnType(); }
/** * Add Method to ConstPool. If method was not in the ConstPool will add and return index, otherwise will return index of already existing entry of constpool */ private static int addMethod(ConstPool cPool, CtMethod method) { // addMethodrefInfo is a safe add, if constant already present it return the existing value without adding. return cPool.addMethodrefInfo( cPool.getThisClassInfo(), method.getName(), method.getSignature() ); }
private String computeReturnType(CtMethod oldMethod) { MethodDescriptorParser parser = new MethodDescriptorParser(); parser.parse(oldMethod.getSignature()); return parser.getReturnType(); }
private String getMethodString(CtMethod method) { try { return Modifier.toString(method.getModifiers()) + " " + method.getReturnType().getName() + " " + method.getName() + Descriptor.toString(method.getSignature()) + ";"; } catch (NotFoundException e) { throw new RuntimeException(e); } }