aboutsummaryrefslogtreecommitdiffstats
path: root/testing-client
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2016-11-07 13:04:55 -0800
committerAndy Clement <aclement@pivotal.io>2016-11-07 13:04:55 -0800
commitde34df77ea7f7372894cf1e2352766118a798e98 (patch)
treee0d75970e19c61af1ba204810ee1ebebbd1e8166 /testing-client
parent64c97807a20105644f604fe9b5263acdb63bd41d (diff)
downloadaspectj-de34df77ea7f7372894cf1e2352766118a798e98.tar.gz
aspectj-de34df77ea7f7372894cf1e2352766118a798e98.zip
Upgraded to new JDT compiler - neon.1 and a bit
Diffstat (limited to 'testing-client')
-rw-r--r--testing-client/src/org/aspectj/testing/Tester.java17
-rw-r--r--testing-client/src/org/aspectj/testing/server/TestServer.java6
-rw-r--r--testing-client/testsrc/org/aspectj/testing/TesterTest.java9
3 files changed, 15 insertions, 17 deletions
diff --git a/testing-client/src/org/aspectj/testing/Tester.java b/testing-client/src/org/aspectj/testing/Tester.java
index afd37a492..500c4c363 100644
--- a/testing-client/src/org/aspectj/testing/Tester.java
+++ b/testing-client/src/org/aspectj/testing/Tester.java
@@ -51,10 +51,10 @@ public class Tester {
private static Set notes;
/** <code>List</code> to hold events submitted. */
- private static List actualEvents = new ArrayList();
+ private static List<String> actualEvents = new ArrayList<>();
/** <code>List</code> to hold events we expect. */
- private static List expectedEvents = new ArrayList();
+ private static List<String> expectedEvents = new ArrayList<>();
static {
setBASEDIR(new File("."));
@@ -103,8 +103,8 @@ public class Tester {
/** XXX deprecated #clear() */
public static void clearEvents() {
- actualEvents = new ArrayList();
- expectedEvents = new ArrayList();
+ actualEvents = new ArrayList<>();
+ expectedEvents = new ArrayList<>();
}
@@ -707,10 +707,10 @@ public class Tester {
}
/** @return String[] of differences '{un}expected msg "..." {not} found' */
- private static String[] diffIgnoreDups(Collection set, String[] expected, String msg,
+ private static String[] diffIgnoreDups(Collection<String> set, String[] expected, String msg,
boolean ignoreDups) {
- ArrayList result = new ArrayList();
- ArrayList actual = new ArrayList(set);
+ ArrayList<String> result = new ArrayList<>();
+ ArrayList<String> actual = new ArrayList<>(set);
BitSet hits = new BitSet();
for (int i = 0; i < expected.length; i++) {
if (!actual.remove(expected[i])) {
@@ -722,8 +722,7 @@ public class Tester {
}
}
}
- for (Iterator iter = actual.iterator(); iter.hasNext();) {
- String act = (String) iter.next();
+ for (String act: actual) {
result.add(" unexpected " + msg + " \"" + act + "\" found");
}
return (String[]) result.toArray(new String[0]);
diff --git a/testing-client/src/org/aspectj/testing/server/TestServer.java b/testing-client/src/org/aspectj/testing/server/TestServer.java
index b7b0d762b..12e8d097e 100644
--- a/testing-client/src/org/aspectj/testing/server/TestServer.java
+++ b/testing-client/src/org/aspectj/testing/server/TestServer.java
@@ -32,7 +32,7 @@ public class TestServer implements Runnable {
private boolean exitOnError = true;
private File workingDirectory;
private ClassLoader rootLoader;
- private Map loaders = new HashMap();
+ private Map<String,ClassLoader> loaders = new HashMap<>();
private String mainClass = "UnknownClass";
private String mainLoader = "UnknownLoader";
@@ -75,7 +75,7 @@ public class TestServer implements Runnable {
if (parent == null) error("No such loader: " + parentName);
}
- List urlList = new ArrayList();
+ List<URL> urlList = new ArrayList<>();
st = new StringTokenizer(classpath,";");
while (st.hasMoreTokens()) {
String fileName = st.nextToken();
@@ -93,7 +93,7 @@ public class TestServer implements Runnable {
}
private void createRootLoader () throws IOException {
- List urlList = new ArrayList();
+ List<URL> urlList = new ArrayList();
/* Sandbox */
URL url = workingDirectory.getCanonicalFile().toURL();
diff --git a/testing-client/testsrc/org/aspectj/testing/TesterTest.java b/testing-client/testsrc/org/aspectj/testing/TesterTest.java
index c2fceb81a..d538a63f7 100644
--- a/testing-client/testsrc/org/aspectj/testing/TesterTest.java
+++ b/testing-client/testsrc/org/aspectj/testing/TesterTest.java
@@ -167,8 +167,8 @@ public class TesterTest extends TestCase {
* @author isberg
*/
public static class MyTestReporter implements IMessageHandler {
- public ArrayList failures = new ArrayList();
- public ArrayList passes = new ArrayList();
+ public ArrayList<IMessage> failures = new ArrayList<>();
+ public ArrayList<IMessage> passes = new ArrayList<>();
public void clear() {
failures.clear();
@@ -188,9 +188,8 @@ public class TesterTest extends TestCase {
return gotItem(failures, substring);
}
- boolean gotItem(List list, String substring) {
- for (Iterator iterator = list.iterator(); iterator.hasNext(); ) {
- IMessage element = (IMessage) iterator.next();
+ boolean gotItem(List<IMessage> list, String substring) {
+ for (IMessage element: list) {
String s = element.getMessage();
if ((null != s) && (-1 != s.indexOf(substring))) {
return true;