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 /testing-client | |
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 'testing-client')
-rw-r--r-- | testing-client/src/main/java/org/aspectj/testing/Tester.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/testing-client/src/main/java/org/aspectj/testing/Tester.java b/testing-client/src/main/java/org/aspectj/testing/Tester.java index ed0c60f3a..d42bcd994 100644 --- a/testing-client/src/main/java/org/aspectj/testing/Tester.java +++ b/testing-client/src/main/java/org/aspectj/testing/Tester.java @@ -831,10 +831,10 @@ public class Tester { /** add expected events */ public static void expectEvents(Object[] events) { if (null != events) { - for (int i = 0; i < events.length; i++) { - if (null != events[i]) { - expectEvent(events[i].toString()); - } + for (Object event : events) { + if (null != event) { + expectEvent(event.toString()); + } } } } @@ -842,11 +842,11 @@ public class Tester { /** add expected events */ public static void expectEvents(String[] events) { if (null != events) { - for (int i = 0; i < events.length; i++) { - if (null != events[i]) { - expectEvent(events[i].toString()); - } - } + for (String event : events) { + if (null != event) { + expectEvent(event.toString()); + } + } } } @@ -946,9 +946,9 @@ public class Tester { /** XXX deprecated */ public static void printEvents() { // XXX no clients? - for (Iterator<String> i = actualEvents.iterator(); i.hasNext(); ) { - System.out.println(i.next()); // XXX System.out - } + for (String actualEvent : actualEvents) { + System.out.println(actualEvent); // XXX System.out + } } /** |