From f39b866d064594148ae9cc558bf3bcff4e9804b4 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 14 Sep 2009 20:29:32 +0000 Subject: [PATCH] refactoring --- weaver/src/org/aspectj/weaver/bcel/BcelField.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelField.java b/weaver/src/org/aspectj/weaver/bcel/BcelField.java index e888154dd..146aeb855 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelField.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelField.java @@ -203,15 +203,16 @@ final class BcelField extends ResolvedMemberImpl { if (!annotationsAdded) return field; FieldGen fg = new FieldGen(field, cpg); - AnnotationGen[] alreadyHas = fg.getAnnotations(); + List 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)); -- 2.39.5