public TccClassGenerator addConstructor(Constructor<?> c) { String desc = ReflectUtils.getDesc(c); addConstructor(":" + desc); if (mCopyConstructors == null) mCopyConstructors = new ConcurrentHashMap<String, Constructor<?>>(4); mCopyConstructors.put(desc, c); return this; }
private CtConstructor getCtConstructor(Constructor<?> c) throws NotFoundException { return getCtClass(c.getDeclaringClass()).getConstructor(ReflectUtils.getDesc(c)); }
String desc = ReflectUtils.getDesc(method); if (worked.contains(desc)) continue;
private static int findMethod(Class<?>[] dcs, String desc) { Class<?> cl; Method[] methods; for (int i = 0; i < dcs.length; i++) { cl = dcs[i]; methods = cl.getMethods(); for (Method method : methods) { if (desc.equals(ReflectUtils.getDesc(method))) return i; } } return -1; }
private static int findMethod(Class<?>[] dcs, String desc) { Class<?> cl; Method[] methods; for (int i = 0; i < dcs.length; i++) { cl = dcs[i]; methods = cl.getMethods(); for (Method method : methods) { if (desc.equals(ReflectUtils.getDesc(method))) return i; } } return -1; }
private static void addDesc(Class<?> c) { String desc = ReflectUtils.getDesc(c); int index = mDescList.size(); mDescList.add(desc); mDescMap.put(desc, index); }
private static void addDesc(Class<?> c) { String desc = ReflectUtils.getDesc(c); int index = mDescList.size(); mDescList.add(desc); mDescMap.put(desc, index); }
/** * get constructor desc. * "()V", "(Ljava/lang/String;I)V" * * @param c constructor. * @return desc */ public static String getDesc(final Constructor<?> c) { StringBuilder ret = new StringBuilder("("); Class<?>[] parameterTypes = c.getParameterTypes(); for (int i = 0; i < parameterTypes.length; i++) ret.append(getDesc(parameterTypes[i])); ret.append(')').append('V'); return ret.toString(); }
public ClassGenerator addConstructor(Constructor<?> c) { String desc = ReflectUtils.getDesc(c); addConstructor(":" + desc); if (mCopyConstructors == null) mCopyConstructors = new ConcurrentHashMap<String, Constructor<?>>(4); mCopyConstructors.put(desc, c); return this; }
public ClassGenerator addConstructor(Constructor<?> c) { String desc = ReflectUtils.getDesc(c); addConstructor(":"+desc); if( mCopyConstructors == null ) mCopyConstructors = new ConcurrentHashMap<String, Constructor<?>>(4); mCopyConstructors.put(desc, c); return this; }
public ClassGenerator addConstructor(Constructor<?> c) { String desc = ReflectUtils.getDesc(c); addConstructor(":"+desc); if( mCopyConstructors == null ) mCopyConstructors = new ConcurrentHashMap<String, Constructor<?>>(4); mCopyConstructors.put(desc, c); return this; }
public ClassGenerator addConstructor(Constructor<?> c) { String desc = ReflectUtils.getDesc(c); addConstructor(":" + desc); if (mCopyConstructors == null) mCopyConstructors = new ConcurrentHashMap<String, Constructor<?>>(4); mCopyConstructors.put(desc, c); return this; }
/** * get constructor desc. * "()V", "(Ljava/lang/String;I)V" * * @param c constructor. * @return desc */ public static String getDesc(final CtConstructor c) throws NotFoundException { StringBuilder ret = new StringBuilder("("); CtClass[] parameterTypes = c.getParameterTypes(); for (int i = 0; i < parameterTypes.length; i++) ret.append(getDesc(parameterTypes[i])); ret.append(')').append('V'); return ret.toString(); }
/** * get method desc. * "(I)I", "()V", "(Ljava/lang/String;Z)V". * * @param m method. * @return desc. */ public static String getDescWithoutMethodName(final CtMethod m) throws NotFoundException { StringBuilder ret = new StringBuilder(); ret.append('('); CtClass[] parameterTypes = m.getParameterTypes(); for (int i = 0; i < parameterTypes.length; i++) ret.append(getDesc(parameterTypes[i])); ret.append(')').append(getDesc(m.getReturnType())); return ret.toString(); }
/** * get constructor desc. * "()V", "(Ljava/lang/String;I)V" * * @param c constructor. * @return desc */ public static String getDesc(final CtConstructor c) throws NotFoundException { StringBuilder ret = new StringBuilder("("); CtClass[] parameterTypes = c.getParameterTypes(); for (int i = 0; i < parameterTypes.length; i++) ret.append(getDesc(parameterTypes[i])); ret.append(')').append('V'); return ret.toString(); }
/** * get method desc. * "do(I)I", "do()V", "do(Ljava/lang/String;Z)V" * * @param m method. * @return desc. */ public static String getDesc(final CtMethod m) throws NotFoundException { StringBuilder ret = new StringBuilder(m.getName()).append('('); CtClass[] parameterTypes = m.getParameterTypes(); for (int i = 0; i < parameterTypes.length; i++) ret.append(getDesc(parameterTypes[i])); ret.append(')').append(getDesc(m.getReturnType())); return ret.toString(); }
private CtConstructor getCtConstructor(Constructor<?> c) throws NotFoundException { return getCtClass(c.getDeclaringClass()).getConstructor(ReflectUtils.getDesc(c)); }
private CtConstructor getCtConstructor(Constructor<?> c) throws NotFoundException { return getCtClass(c.getDeclaringClass()).getConstructor(ReflectUtils.getDesc(c)); }
private CtConstructor getCtConstructor(Constructor<?> c) throws NotFoundException { return getCtClass(c.getDeclaringClass()).getConstructor(ReflectUtils.getDesc(c)); }
private CtConstructor getCtConstructor(Constructor<?> c) throws NotFoundException { return getCtClass(c.getDeclaringClass()).getConstructor(ReflectUtils.getDesc(c)); }