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-util/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 'testing-util/src/test')
-rw-r--r-- | testing-util/src/test/java/org/aspectj/testingutil/TestUtilTest.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/testing-util/src/test/java/org/aspectj/testingutil/TestUtilTest.java b/testing-util/src/test/java/org/aspectj/testingutil/TestUtilTest.java index 3a514a0ed..0807bd2a3 100644 --- a/testing-util/src/test/java/org/aspectj/testingutil/TestUtilTest.java +++ b/testing-util/src/test/java/org/aspectj/testingutil/TestUtilTest.java @@ -96,15 +96,15 @@ public class TestUtilTest extends TestCase { public void testParseBoolean() { { String[] trues = {"true", "TRUE", "on", "ON" }; - for (int i = 0; i < trues.length; i++) { - assertTrue(trues[i], TestUtil.parseBoolean(trues[i])); - } + for (String aTrue : trues) { + assertTrue(aTrue, TestUtil.parseBoolean(aTrue)); + } } { String[] falses = {"false", "FALSE", "off", "off" }; - for (int i = 0; i < falses.length; i++) { - assertTrue(falses[i], !TestUtil.parseBoolean(falses[i])); - } + for (String fals : falses) { + assertTrue(fals, !TestUtil.parseBoolean(fals)); + } } String[] errors = {"fals", "tru", "T", "on of" }; boolean fail = false; |