@Override public void edit(ConstructorCall c) throws CannotCompileException { try { put(c.getConstructor().getDeclaringClass().getName() + "." + "<init>" + "(" + parameterNames(c.getConstructor().getMethodInfo()) + ")", c.getLineNumber(), key); } catch (NotFoundException e) { throw new ReflectionsException("Could not find member " + c.getClassName() + " in " + key, e); } }
/** * Returns <code>"super"</code> or "<code>"this"</code>. */ public String getMethodName() { return isSuper() ? "super" : "this"; }
/** * Returns the called constructor. */ public CtConstructor getConstructor() throws NotFoundException { return getCtClass().getConstructor(getSignature()); }
MethodCall mcall = new MethodCall(pos, iterator, clazz, minfo); if (mcall.getMethodName().equals(MethodInfo.nameInit)) { ConstructorCall ccall = new ConstructorCall(pos, iterator, clazz, minfo); expr = ccall; edit(ccall);
@Override public void edit(final ConstructorCall call) throws CannotCompileException { if (debug) { System.err.println("editing ctor " + call.getClassName() + "#" + call.getMethodName() + " (wanted " + calledClass + "#" + calledMethodName + ")"); } if (call.getMethodName().equals(calledMethodName) && call.getClassName().equals(calledClass)) { if (onlyNth > 0 && ++counter != onlyNth) return; call.replace(newCode); markEdited(); } }
if (strategy != INST_REDEFINE && !c.getClassName().startsWith("java.lang")) { final CtClass superclass; try { code.append(" $proceed($$);"); code.append("}}"); c.replace(code.toString());
final boolean isSuper = call.isSuper(); final CtClass[] parameterTypes = isSuper ? ((ConstructorCall) call).getConstructor() .getParameterTypes() : call.getMethod().getParameterTypes(); if (parameterTypes.length < parameterIndex) {
@Override public void edit(final ConstructorCall call) throws CannotCompileException { if (call.getMethodName().equals("super")) call.replace("super();"); } });
MethodCall mcall = new MethodCall(pos, iterator, clazz, minfo); if (mcall.getMethodName().equals(MethodInfo.nameInit)) { ConstructorCall ccall = new ConstructorCall(pos, iterator, clazz, minfo); expr = ccall; edit(ccall);
@Override public void edit(final ConstructorCall call) throws CannotCompileException { if (debug) { System.err.println("editing ctor " + call.getClassName() + "#" + call.getMethodName() + " (wanted " + calledClass + "#" + calledMethodName + ")"); } if (call.getMethodName().equals(calledMethodName) && call.getClassName().equals(calledClass)) { if (onlyNth > 0 && ++counter != onlyNth) return; call.replace(newCode); markEdited(); } }
final boolean isSuper = call.isSuper(); final CtClass[] parameterTypes = isSuper ? ((ConstructorCall) call).getConstructor() .getParameterTypes() : call.getMethod().getParameterTypes(); if (parameterTypes.length < parameterIndex) {
@Override public void edit(final ConstructorCall call) throws CannotCompileException { if (call.getMethodName().equals("super")) call.replace("super();"); } });
@Override public void edit(ConstructorCall c) throws CannotCompileException { try { put(c.getConstructor().getDeclaringClass().getName() + "." + "<init>" + "(" + parameterNames(c.getConstructor().getMethodInfo()) + ")", c.getLineNumber(), key); } catch (NotFoundException e) { throw new ReflectionsException("Could not find member " + c.getClassName() + " in " + key, e); } }
/** * Returns the called constructor. */ public CtConstructor getConstructor() throws NotFoundException { return getCtClass().getConstructor(getSignature()); }
/** * Returns <code>"super"</code> or "<code>"this"</code>. */ @Override public String getMethodName() { return isSuper() ? "super" : "this"; }
MethodCall mcall = new MethodCall(pos, iterator, clazz, minfo); if (mcall.getMethodName().equals(MethodInfo.nameInit)) { ConstructorCall ccall = new ConstructorCall(pos, iterator, clazz, minfo); expr = ccall; edit(ccall);
@Override public void edit(ConstructorCall c) throws CannotCompileException { try { put(c.getConstructor().getDeclaringClass().getName() + "." + "<init>" + "(" + parameterNames(c.getConstructor().getMethodInfo()) + ")", c.getLineNumber(), key); } catch (NotFoundException e) { throw new ReflectionsException("Could not find member " + c.getClassName() + " in " + key, e); } }
/** * Returns the called constructor. */ public CtConstructor getConstructor() throws NotFoundException { return getCtClass().getConstructor(getSignature()); }
/** * Returns <code>"super"</code> or "<code>"this"</code>. */ public String getMethodName() { return isSuper() ? "super" : "this"; }