aboutsummaryrefslogtreecommitdiffstats
path: root/testing-util
diff options
context:
space:
mode:
Diffstat (limited to 'testing-util')
-rw-r--r--testing-util/src/main/java/org/aspectj/testing/util/TestUtil.java16
-rw-r--r--testing-util/src/test/java/org/aspectj/testingutil/TestUtilTest.java12
2 files changed, 14 insertions, 14 deletions
diff --git a/testing-util/src/main/java/org/aspectj/testing/util/TestUtil.java b/testing-util/src/main/java/org/aspectj/testing/util/TestUtil.java
index ef6109e37..6be6cc61e 100644
--- a/testing-util/src/main/java/org/aspectj/testing/util/TestUtil.java
+++ b/testing-util/src/main/java/org/aspectj/testing/util/TestUtil.java
@@ -126,8 +126,8 @@ public final class TestUtil {
// TODO support others loaded dynamically
Map<String,Object> map = new HashMap<>();
- for (Iterator<Object> iter = LIB_RPATHS.keySet().iterator(); iter.hasNext();) {
- String key = (String) iter.next();
+ for (Object o : LIB_RPATHS.keySet()) {
+ String key = (String) o;
String path = LIB_RPATHS.getProperty(key);
File file = null;
URL url = null;
@@ -206,14 +206,14 @@ public final class TestUtil {
}
StringBuffer path = new StringBuffer();
boolean started = false;
- for (int i = 0; i < entries.length; i++) {
- if (null != entries[i]) {
+ for (Object entry : entries) {
+ if (null != entry) {
if (started) {
path.append(File.pathSeparator);
} else {
started = true;
}
- path.append(entries[i].toString());
+ path.append(entry.toString());
}
}
return path.toString();
@@ -476,11 +476,11 @@ public final class TestUtil {
}
String[] paths = FileUtil.listFiles(expectedBaseDir);
boolean result = true;
- for (int i = 0; i < paths.length; i++) {
- if (-1 != paths[i].indexOf("CVS")) {
+ for (String path : paths) {
+ if (-1 != path.indexOf("CVS")) {
continue;
}
- if (!sameFiles(handler, expectedBaseDir, actualBaseDir, paths[i]) && result) {
+ if (!sameFiles(handler, expectedBaseDir, actualBaseDir, path) && result) {
result = false;
if (fastFail) {
break;
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;