]> source.dussan.org Git - aspectj.git/commitdiff
refactoring
authoraclement <aclement>
Mon, 14 Sep 2009 20:29:32 +0000 (20:29 +0000)
committeraclement <aclement>
Mon, 14 Sep 2009 20:29:32 +0000 (20:29 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelField.java

index e888154ddd378a570c9a05f2d2acf909036a9d47..146aeb855874bf63e957fe1902fd0c3379f81784 100644 (file)
@@ -203,15 +203,16 @@ final class BcelField extends ResolvedMemberImpl {
                if (!annotationsAdded)
                        return field;
                FieldGen fg = new FieldGen(field, cpg);
-               AnnotationGen[] alreadyHas = fg.getAnnotations();
+               List<AnnotationGen> alreadyHas = fg.getAnnotations();
                if (annotations != null) {
                        for (int i = 0; i < annotations.length; i++) {
                                AnnotationAJ array_element = annotations[i];
                                boolean alreadyHasIt = false;
-                               for (int j = 0; j < alreadyHas.length; j++) {
-                                       AnnotationGen gen = alreadyHas[j];
-                                       if (gen.getTypeName().equals(array_element.getTypeName()))
+                               for (AnnotationGen gen : alreadyHas) {
+                                       if (gen.getTypeName().equals(array_element.getTypeName())) {
                                                alreadyHasIt = true;
+                                               break;
+                                       }
                                }
                                if (!alreadyHasIt)
                                        fg.addAnnotation(new AnnotationGen(((BcelAnnotation) array_element).getBcelAnnotation(), cpg, true));