@Override public String getName() { return ctConstructor.getName(); }
@Override public String getName() { return ctConstructor.getName(); }
@Override public String getName() { return ctConstructor.getName(); }
@Override public String toString() { return getClass().getSimpleName() + "{" + "ctConstructor=" + ctConstructor.getName() + ", typeSolver=" + typeSolver + '}'; }
public static void disassemble(CtClass clazz, PrintStream out, boolean evenSuperclassMethods) { out.println("Class " + clazz.getName()); for (CtConstructor ctor : clazz.getConstructors()) try { disassemble(ctor.toMethod(ctor.getName(), clazz), out); } catch (CannotCompileException e) { e.printStackTrace(out); } for (CtMethod method : clazz.getDeclaredMethods()) if (evenSuperclassMethods || method.getDeclaringClass().equals(clazz)) disassemble(method, out); }
log.debug("instrumenting constructor:" + clazz.getName() + "." + constructor.getName() + "(" + constructor.getSignature() + ")"); if (instrumentConstructor(clazz, constructor)) { countCounstructors++;
CtConstructor foundMethod = newConstructorsMap.get(longName); if (foundMethod == null) { JApiConstructor jApiConstructor = new JApiConstructor(jApiClass, ctMethod.getName(), JApiChangeStatus.REMOVED, Optional.of(ctMethod), Optional.<CtConstructor>absent(), jarArchiveComparator); addParametersToMethod(methodDescriptorParser, jApiConstructor); if (includeConstructor(jApiConstructor)) { JApiConstructor jApiConstructor = new JApiConstructor(jApiClass, ctMethod.getName(), JApiChangeStatus.UNCHANGED, Optional.of(ctMethod), Optional.of(foundMethod), jarArchiveComparator); addParametersToMethod(methodDescriptorParser, jApiConstructor); if (includeConstructor(jApiConstructor)) { CtConstructor foundMethod = oldConstructorsMap.get(longName); if (foundMethod == null) { JApiConstructor jApiConstructor = new JApiConstructor(jApiClass, ctMethod.getName(), JApiChangeStatus.NEW, Optional.<CtConstructor>absent(), Optional.of(ctMethod), jarArchiveComparator); addParametersToMethod(methodDescriptorParser, jApiConstructor); if (includeConstructor(jApiConstructor)) {
private boolean instrumentConstructor(CtConstructor c) throws ClassNotFoundException, CannotCompileException { Pre posti = (Pre) c.getAnnotation(Pre.class); if (posti != null) { throw new CannotCompileException( c.getLongName() + " is a constructor may not be annotated with a @Post annotation as any super() in the constructor must be called before injected chex."); } boolean workDone = false; Post post = (Post) c.getAnnotation(Post.class); if (post != null ) { String preValue = post.value().trim(); if( preValue.equals("") ){ preValue = c.getName()+"$Post($$)"; } String code = this.createCode(preValue, post.message()); c.insertAfter(code); workDone = true; } return workDone; } }
CtConstructor foundMethod = newConstructorsMap.get(longName); if (foundMethod == null) { JApiConstructor jApiConstructor = new JApiConstructor(jApiClass, ctMethod.getName(), JApiChangeStatus.REMOVED, Optional.of(ctMethod), Optional.<CtConstructor>absent(), jarArchiveComparator); addParametersToMethod(methodDescriptorParser, jApiConstructor); if (includeConstructor(jApiConstructor)) { JApiConstructor jApiConstructor = new JApiConstructor(jApiClass, ctMethod.getName(), JApiChangeStatus.UNCHANGED, Optional.of(ctMethod), Optional.of(foundMethod), jarArchiveComparator); addParametersToMethod(methodDescriptorParser, jApiConstructor); if (includeConstructor(jApiConstructor)) { CtConstructor foundMethod = oldConstructorsMap.get(longName); if (foundMethod == null) { JApiConstructor jApiConstructor = new JApiConstructor(jApiClass, ctMethod.getName(), JApiChangeStatus.NEW, Optional.<CtConstructor>absent(), Optional.of(ctMethod), jarArchiveComparator); addParametersToMethod(methodDescriptorParser, jApiConstructor); if (includeConstructor(jApiConstructor)) {