private Signature loadMethod(int index) { return new Signature("CGLIB$LOAD_PRIVATE_" + index, Constants.TYPE_OBJECT, Constants.TYPES_EMPTY); }
private static Signature readMethodSig(String name, String desc) { return new Signature("$cglib_read_" + name, "()" + desc); }
private Signature loadMethod(int index) { return new Signature("CGLIB$LOAD_PRIVATE_" + index, Constants.TYPE_OBJECT, Constants.TYPES_EMPTY); }
private static Signature writeMethodSig(String name, String desc) { return new Signature("$cglib_write_" + name, "(" + desc + ")V"); }
public static Signature parseConstructor(Type[] types) { StringBuffer sb = new StringBuffer(); sb.append("("); for (int i = 0; i < types.length; i++) { sb.append(types[i].getDescriptor()); } sb.append(")"); sb.append("V"); return new Signature(Constants.CONSTRUCTOR_NAME, sb.toString()); }
public static Signature parseConstructor(Type[] types) { StringBuffer sb = new StringBuffer(); sb.append("("); for (int i = 0; i < types.length; i++) { sb.append(types[i].getDescriptor()); } sb.append(")"); sb.append("V"); return new Signature(Constants.CONSTRUCTOR_NAME, sb.toString()); }
public void visitMethodInsn( int opcode, String owner, String name, String desc, boolean itf) { if (opcode == Opcodes.INVOKESPECIAL && currentMethodSig != null) { Signature target = new Signature(name, desc); if (target.equals(currentMethodSig)) { rejected.add(currentMethod); } currentMethodSig = null; } } };
/** * For internal use by {@link Enhancer} only; see the {@link net.sf.cglib.reflect.FastMethod} class * for similar functionality. */ public static MethodProxy create(Class c1, Class c2, String desc, String name1, String name2) { MethodProxy proxy = new MethodProxy(); proxy.sig1 = new Signature(name1, desc); proxy.sig2 = new Signature(name2, desc); proxy.createInfo = new CreateInfo(c1, c2); return proxy; }
private static int helper(FastClass fc, Method method) { int index = fc.getIndex(new Signature(method.getName(), Type.getMethodDescriptor(method))); if (index < 0) { Class[] types = method.getParameterTypes(); System.err.println("hash=" + method.getName().hashCode() + " size=" + types.length); for (int i = 0; i < types.length; i++) { System.err.println(" types[" + i + "]=" + types[i].getName()); } throw new IllegalArgumentException("Cannot find method " + method); } return index; }
/** * For internal use by {@link Enhancer} only; see the {@link net.sf.cglib.reflect.FastMethod} class * for similar functionality. */ public static MethodProxy create(Class c1, Class c2, String desc, String name1, String name2) { MethodProxy proxy = new MethodProxy(); proxy.sig1 = new Signature(name1, desc); proxy.sig2 = new Signature(name2, desc); proxy.createInfo = new CreateInfo(c1, c2); return proxy; }
public void visitMethodInsn( int opcode, String owner, String name, String desc, boolean itf) { if (opcode == Opcodes.INVOKESPECIAL && currentMethodSig != null) { Signature target = new Signature(name, desc); if (target.equals(currentMethodSig)) { rejected.add(currentMethod); } currentMethodSig = null; } } };
public static Signature getSignature(Member member) { if (member instanceof Method) { return new Signature(member.getName(), Type.getMethodDescriptor((Method)member)); } else if (member instanceof Constructor) { Type[] types = TypeUtils.getTypes(((Constructor)member).getParameterTypes()); return new Signature(Constants.CONSTRUCTOR_NAME, Type.getMethodDescriptor(Type.VOID_TYPE, types)); } else { throw new IllegalArgumentException("Cannot get signature of a field"); } }
public static Signature getSignature(Member member) { if (member instanceof Method) { return new Signature(member.getName(), Type.getMethodDescriptor((Method)member)); } else if (member instanceof Constructor) { Type[] types = TypeUtils.getTypes(((Constructor)member).getParameterTypes()); return new Signature(Constants.CONSTRUCTOR_NAME, Type.getMethodDescriptor(Type.VOID_TYPE, types)); } else { throw new IllegalArgumentException("Cannot get signature of a field"); } }
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { return begin_method(access, new Signature(name, desc), TypeUtils.fromInternalNames(exceptions)); } }
private static Signature writeCallbackSig(Type type) { Type remap = remap(type); return new Signature("write" + callbackName(remap), remap, new Type[]{ Constants.TYPE_OBJECT, Constants.TYPE_STRING, remap, remap }); }
private static Signature readCallbackSig(Type type) { Type remap = remap(type); return new Signature("read" + callbackName(remap), remap, new Type[]{ Constants.TYPE_OBJECT, Constants.TYPE_STRING, remap }); }
private Signature rename(Signature sig, int index) { return new Signature("CGLIB$" + sig.getName() + "$" + index, sig.getDescriptor()); }
private static Signature readCallbackSig(Type type) { Type remap = remap(type); return new Signature("read" + callbackName(remap), remap, new Type[]{ Constants.TYPE_OBJECT, Constants.TYPE_STRING, remap }); }
private static Signature writeCallbackSig(Type type) { Type remap = remap(type); return new Signature("write" + callbackName(remap), remap, new Type[]{ Constants.TYPE_OBJECT, Constants.TYPE_STRING, remap, remap }); }
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { return begin_method(access, new Signature(name, desc), TypeUtils.fromInternalNames(exceptions)); } }