public void testAnnotationsAndItds_pr98901() { runTest("annotations and itds");}
public void testAnnotationsAndItds_pr98901_2() { runTest("annotations and itds - 2");}
public void testCircularGenerics_pr133307() { runTest("circular generics");}
- // public void testDeca() { runTest("doubly annotating a method with declare");}
- // public void testDeca2() { runTest("doubly annotating a method with declare - 2");}
+ public void testDeca() { runTest("doubly annotating a method with declare");}
+ public void testDeca2() { runTest("doubly annotating a method with declare - 2");}
public void testCrashingWithASM_pr132926_1() { runTest("crashing on annotation type resolving with asm - 1");}
public void testCrashingWithASM_pr132926_2() { runTest("crashing on annotation type resolving with asm - 2");}
public void testCrashingWithASM_pr132926_3() { runTest("crashing on annotation type resolving with asm - 3");}
// Single first pass
List worthRetrying = new ArrayList();
boolean modificationOccured = false;
-
+ List /*AnnotationGen*/ annotationsToAdd = null;
for (Iterator iter = decaMs.iterator(); iter.hasNext();) {
DeclareAnnotation decaM = (DeclareAnnotation) iter.next();
unusedDecams.remove(decaM);
continue; // skip this one...
}
-
+
+ if (annotationsToAdd==null) annotationsToAdd = new ArrayList();
Annotation a = decaM.getAnnotationX().getBcelAnnotation();
AnnotationGen ag = new AnnotationGen(a,clazz.getConstantPoolGen(),true);
- Method oldMethod = mg.getMethod();
- MethodGen myGen = new MethodGen(oldMethod,clazz.getClassName(),clazz.getConstantPoolGen(),false);// dont use tags, they won't get repaired like for woven methods.
- myGen.addAnnotation(ag);
- Method newMethod = myGen.getMethod();
+ annotationsToAdd.add(ag);
mg.addAnnotation(decaM.getAnnotationX());
- members.set(memberCounter,new LazyMethodGen(newMethod,clazz));
AsmRelationshipProvider.getDefault().addDeclareAnnotationRelationship(decaM.getSourceLocation(),clazz.getName(),mg.getMethod());
reportMethodCtorWeavingMessage(clazz, mg.getMemberView(), decaM,mg.getDeclarationLineNumber());
unusedDecams.remove(decaM);
continue; // skip this one...
}
+
+ if (annotationsToAdd==null) annotationsToAdd = new ArrayList();
+ Annotation a = decaM.getAnnotationX().getBcelAnnotation();
+ AnnotationGen ag = new AnnotationGen(a,clazz.getConstantPoolGen(),true);
+ annotationsToAdd.add(ag);
+
mg.addAnnotation(decaM.getAnnotationX());
AsmRelationshipProvider.getDefault().addDeclareAnnotationRelationship(decaM.getSourceLocation(),clazz.getName(),mg.getMethod());
isChanged = true;
}
worthRetrying.removeAll(forRemoval);
}
+ if (annotationsToAdd!=null) {
+ Method oldMethod = mg.getMethod();
+ MethodGen myGen = new MethodGen(oldMethod,clazz.getClassName(),clazz.getConstantPoolGen(),false);// dont use tags, they won't get repaired like for woven methods.
+ for (Iterator iter = annotationsToAdd.iterator(); iter.hasNext();) {
+ AnnotationGen a = (AnnotationGen) iter.next();
+ myGen.addAnnotation(a);
+ }
+ Method newMethod = myGen.getMethod();
+ members.set(memberCounter,new LazyMethodGen(newMethod,clazz));
+ }
+
}
}
checkUnusedDeclareAtTypes(unusedDecams, false);