@Test public void testShouldTransform_does_filter_correctly_a_mimic_annotation() throws Exception { addMimicAnnotation(dst, src.getName(), true, true, true, true); boolean filter = mimicProcessor.shouldTransform(dst); assertTrue(filter); }
@Override protected boolean shouldTransform(CtClass candidateClass) throws Exception { if (candidateClass.getDeclaringClass() != null && (candidateClass.getModifiers() & Modifier.STATIC) == 0) { return false; } return candidateClass.hasAnnotation(Mimic.class); }
MimicProcessor extends ClassTransformer { @Override protected boolean shouldTransform(CtClass candidateClass) throws Exception { if (candidateClass.getDeclaringClass() != null && (candidateClass.getModifiers() & Modifier.STATIC) == 0) { return false; } return candidateClass.hasAnnotation(Mimic.class); } }
MimicProcessor extends ClassTransformer { @Override protected boolean shouldTransform(CtClass candidateClass) throws Exception { if (candidateClass.getDeclaringClass() != null && (candidateClass.getModifiers() & Modifier.STATIC) == 0) { return false; } return candidateClass.hasAnnotation(Mimic.class); } MimicProcessor(); }
MimicProcessor extends ClassTransformer { @Override protected boolean shouldTransform(CtClass candidateClass) throws Exception { if (candidateClass.getDeclaringClass() != null && (candidateClass.getModifiers() & Modifier.STATIC) == 0) { return false; } return candidateClass.hasAnnotation(Mimic.class); } MimicProcessor();  }
MimicProcessor extends ClassTransformer { @Override protected boolean shouldTransform(CtClass candidateClass) throws Exception { if (candidateClass.getDeclaringClass() != null && (candidateClass.getModifiers() & Modifier.STATIC) == 0) { return false; } return candidateClass.hasAnnotation(Mimic.class); } MimicProcessor();   }