diff options
author | Lars Grefer <eclipse@larsgrefer.de> | 2020-08-08 03:06:37 +0200 |
---|---|---|
committer | Lars Grefer <eclipse@larsgrefer.de> | 2020-08-08 03:06:37 +0200 |
commit | 72194b7982ddfa8e9864d0a9934905bb76b90f33 (patch) | |
tree | ebed806c358c1a3960c5d6be4c13b26ca41809df /org.aspectj.matcher/src/main/java/org/aspectj/weaver/AbstractAnnotationAJ.java | |
parent | c3289ab86bfb2c97cf34147239b3dde46de92a7c (diff) | |
download | aspectj-72194b7982ddfa8e9864d0a9934905bb76b90f33.tar.gz aspectj-72194b7982ddfa8e9864d0a9934905bb76b90f33.zip |
'for' loop replaceable with enhanced 'for' loop
Reports for loops which iterate over collections or arrays, and can be replaced with an enhanced for loop (i.e. the foreach iteration syntax).
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
Diffstat (limited to 'org.aspectj.matcher/src/main/java/org/aspectj/weaver/AbstractAnnotationAJ.java')
-rw-r--r-- | org.aspectj.matcher/src/main/java/org/aspectj/weaver/AbstractAnnotationAJ.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/AbstractAnnotationAJ.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/AbstractAnnotationAJ.java index 503d6b3b5..e098251d1 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/AbstractAnnotationAJ.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/AbstractAnnotationAJ.java @@ -121,10 +121,9 @@ public abstract class AbstractAnnotationAJ implements AnnotationAJ { */ private final AnnotationAJ retrieveAnnotationOnAnnotation(UnresolvedType requiredAnnotationSignature) { AnnotationAJ[] annos = type.getAnnotations(); - for (int i = 0; i < annos.length; i++) { - AnnotationAJ a = annos[i]; + for (AnnotationAJ a : annos) { if (a.getTypeSignature().equals(requiredAnnotationSignature.getSignature())) { - return annos[i]; + return a; } } return null; |