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 /bridge/src/test | |
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 'bridge/src/test')
-rw-r--r-- | bridge/src/test/java/org/aspectj/bridge/MessageTest.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/bridge/src/test/java/org/aspectj/bridge/MessageTest.java b/bridge/src/test/java/org/aspectj/bridge/MessageTest.java index be30c48ba..d3bd73be6 100644 --- a/bridge/src/test/java/org/aspectj/bridge/MessageTest.java +++ b/bridge/src/test/java/org/aspectj/bridge/MessageTest.java @@ -74,18 +74,18 @@ public class MessageTest extends TestCase { public void testKind_isSameOrLessThan() { IMessage.Kind last; IMessage.Kind next = null; - for (Iterator<IMessage.Kind> iter = IMessage.KINDS.iterator(); iter.hasNext();) { - last = next; - next = iter.next(); - if (null == last) { - continue; - } - String label = "last: " + last + " next: " + next; - assertTrue(label, !next.isSameOrLessThan(null)); - assertTrue(label, !next.isSameOrLessThan(last)); - assertTrue(label, last.isSameOrLessThan(next)); - assertTrue(label, next.isSameOrLessThan(next)); - } + for (IMessage.Kind kind : IMessage.KINDS) { + last = next; + next = kind; + if (null == last) { + continue; + } + String label = "last: " + last + " next: " + next; + assertTrue(label, !next.isSameOrLessThan(null)); + assertTrue(label, !next.isSameOrLessThan(last)); + assertTrue(label, last.isSameOrLessThan(next)); + assertTrue(label, next.isSameOrLessThan(next)); + } } public void testMessageHandler() { |