aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorLars Grefer <eclipse@larsgrefer.de>2020-08-15 17:01:46 +0200
committerLars Grefer <eclipse@larsgrefer.de>2020-08-15 17:01:46 +0200
commit639f5030e0391e831138f9786cf831c3374449e7 (patch)
treefc4e616cb6df8e73722a6d0cf83a55efd6d87387 /testing
parent2409bcbc7c9606b055e23f52d688eecda84351d6 (diff)
downloadaspectj-639f5030e0391e831138f9786cf831c3374449e7.tar.gz
aspectj-639f5030e0391e831138f9786cf831c3374449e7.zip
Weaken Collection declarations
Reports on declarations of Collection variables made by using the collection class as the type, rather than an appropriate interface. Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
Diffstat (limited to 'testing')
-rw-r--r--testing/src/test/java/org/aspectj/testing/harness/bridge/AbstractRunSpec.java6
-rw-r--r--testing/src/test/java/org/aspectj/testing/harness/bridge/AjcSpecTest.java2
-rw-r--r--testing/src/test/java/org/aspectj/testing/harness/bridge/AjcTest.java4
-rw-r--r--testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRun.java4
-rw-r--r--testing/src/test/java/org/aspectj/testing/harness/bridge/DirChanges.java8
-rw-r--r--testing/src/test/java/org/aspectj/testing/harness/bridge/FlatSuiteReader.java6
-rw-r--r--testing/src/test/java/org/aspectj/testing/harness/bridge/Globals.java2
-rw-r--r--testing/src/test/java/org/aspectj/testing/harness/bridge/IncCompilerRun.java2
-rw-r--r--testing/src/test/java/org/aspectj/testing/harness/bridge/Validator.java11
-rw-r--r--testing/src/test/java/org/aspectj/testing/run/RunListeners.java3
-rw-r--r--testing/src/test/java/org/aspectj/testing/taskdefs/AjcTaskCompileCommandTest.java5
-rw-r--r--testing/src/test/java/org/aspectj/testing/util/Diffs.java8
-rw-r--r--testing/src/test/java/org/aspectj/testing/util/FileUtil.java11
-rw-r--r--testing/src/test/java/org/aspectj/testing/util/LangUtil.java6
-rw-r--r--testing/src/test/java/org/aspectj/testing/util/LangUtilTest.java18
-rw-r--r--testing/src/test/java/org/aspectj/testing/util/LinkCheck.java10
-rw-r--r--testing/src/test/java/org/aspectj/testing/util/MessageUtilTest.java6
-rw-r--r--testing/src/test/java/org/aspectj/testing/util/TestClassLoader.java2
-rw-r--r--testing/src/test/java/org/aspectj/testing/util/TestDiffs.java6
-rw-r--r--testing/src/test/java/org/aspectj/testing/util/TestDiffsTest.java3
-rw-r--r--testing/src/test/java/org/aspectj/testing/util/options/Option.java2
-rw-r--r--testing/src/test/java/org/aspectj/testing/util/options/Options.java3
-rw-r--r--testing/src/test/java/org/aspectj/testing/xml/AjcSpecXmlReaderTest.java7
-rw-r--r--testing/src/test/java/org/aspectj/testing/xml/MessageListXmlReaderTest.java3
-rw-r--r--testing/src/test/java/org/aspectj/testing/xml/SoftMessage.java2
25 files changed, 68 insertions, 72 deletions
diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/AbstractRunSpec.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/AbstractRunSpec.java
index cf615f6d1..ed4f560c0 100644
--- a/testing/src/test/java/org/aspectj/testing/harness/bridge/AbstractRunSpec.java
+++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/AbstractRunSpec.java
@@ -83,7 +83,7 @@ abstract public class AbstractRunSpec implements IRunSpec {
private boolean skipAll;
protected String xmlElementName; // nonfinal only for clone()
- protected final ArrayList<String> keywords;
+ protected final List<String> keywords;
protected final IMessageHolder /* IMessage */messages;
protected final ArrayList<String> options;
protected final ArrayList<String> paths;
@@ -197,7 +197,7 @@ abstract public class AbstractRunSpec implements IRunSpec {
}
}
- public ArrayList<String> getKeywordsList() {
+ public List<String> getKeywordsList() {
return makeList(keywords);
}
@@ -257,7 +257,7 @@ abstract public class AbstractRunSpec implements IRunSpec {
// --------------- (String) paths
/** @return ArrayList of String paths */
- public ArrayList<String> getPathsList() {
+ public List<String> getPathsList() {
return makeList(paths);
}
diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/AjcSpecTest.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/AjcSpecTest.java
index 52a3e2266..2ff173362 100644
--- a/testing/src/test/java/org/aspectj/testing/harness/bridge/AjcSpecTest.java
+++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/AjcSpecTest.java
@@ -250,7 +250,7 @@ public class AjcSpecTest extends TestCase {
sameDirChangesList(lhs.dirChanges, rhs.dirChanges, a);
}
- public static void sameDirChangesList(ArrayList<DirChanges.Spec> lhs, ArrayList<DirChanges.Spec> rhs, Assert a) {
+ public static void sameDirChangesList(List<DirChanges.Spec> lhs, List<DirChanges.Spec> rhs, Assert a) {
if ((null == lhs) && (null == rhs)) {
return;
}
diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/AjcTest.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/AjcTest.java
index 7bbc50adf..5ca41509f 100644
--- a/testing/src/test/java/org/aspectj/testing/harness/bridge/AjcTest.java
+++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/AjcTest.java
@@ -161,7 +161,7 @@ public class AjcTest extends RunSpecIterator {
* @return the unmodifiable List of titles (maybe empty, never null)
*/
private static List<String> parseTitlesList(String titlesList) {
- ArrayList<String> result = new ArrayList<>();
+ List<String> result = new ArrayList<>();
String last = null;
StringTokenizer st = new StringTokenizer(titlesList, ",");
while (st.hasMoreTokens()) {
@@ -206,7 +206,7 @@ public class AjcTest extends RunSpecIterator {
* @return the unmodifiable List of titles (maybe empty, never null)
*/
private static List<String> readTitlesFile(File titlesFile, boolean fail) {
- ArrayList<String> result = new ArrayList<>();
+ List<String> result = new ArrayList<>();
Reader reader = null;
try {
reader = new FileReader(titlesFile);
diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRun.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRun.java
index 7a5bff3df..25ca084bf 100644
--- a/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRun.java
+++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRun.java
@@ -729,7 +729,7 @@ public class CompilerRun implements IAjcRun {
private static String updateBootclasspathForSourceVersion(
String sourceVersion,
String compilerName,
- ArrayList toAdd) {
+ List toAdd) {
if (null == sourceVersion) {
return null;
}
@@ -1497,7 +1497,7 @@ public class CompilerRun implements IAjcRun {
String seek;
/** if setup completed, this has the combined global/local options */
- ArrayList commandOptions;
+ List commandOptions;
public Object clone() {
TestSetup testSetup = new TestSetup();
diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/DirChanges.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/DirChanges.java
index e3e60e028..18b05982c 100644
--- a/testing/src/test/java/org/aspectj/testing/harness/bridge/DirChanges.java
+++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/DirChanges.java
@@ -469,19 +469,19 @@ public class DirChanges {
boolean fastFail;
/** relative paths (String) of expected files added */
- final ArrayList<String> added;
+ final List<String> added;
/** relative paths (String) of expected files removed/deleted */
- final ArrayList<String> removed;
+ final List<String> removed;
/** relative paths (String) of expected files updated/changed */
- final ArrayList<String> updated;
+ final List<String> updated;
/** relative paths (String) of expected files NOT
* added, removed, or changed
* XXX unchanged unimplemented
*/
- final ArrayList<String> unchanged;
+ final List<String> unchanged;
public Spec() {
added = new ArrayList<>();
diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/FlatSuiteReader.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/FlatSuiteReader.java
index 28db821cb..696d491a5 100644
--- a/testing/src/test/java/org/aspectj/testing/harness/bridge/FlatSuiteReader.java
+++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/FlatSuiteReader.java
@@ -150,7 +150,7 @@ public class FlatSuiteReader implements SFileReader.Maker {
throw new AbortException("expected sources at " + reader);
}
- ArrayList<Message> exp = new ArrayList<>();
+ List<Message> exp = new ArrayList<>();
// !compile || noerrors || className {runOption..}
String first = words[0];
if ("!compile".equals(first)) {
@@ -290,7 +290,7 @@ public class FlatSuiteReader implements SFileReader.Maker {
result.description = input;
ArrayList<String> newOptions = new ArrayList<>();
- ArrayList<String> optionsCopy = result.getOptionsList();
+ Iterable<String> optionsCopy = result.getOptionsList();
for (String option: optionsCopy) {
if (option.startsWith("-")) {
newOptions.add("!" + option.substring(1));
@@ -325,7 +325,7 @@ public class FlatSuiteReader implements SFileReader.Maker {
*/
private List<Message> makeMessages(// XXX weak - also support expected exceptions, etc.
Kind kind, String[] words, int start, File lastFile) {
- ArrayList<Message> result = new ArrayList<>();
+ List<Message> result = new ArrayList<>();
for (int i = start; i < words.length; i++) {
ISourceLocation sl =
BridgeUtil.makeSourceLocation(words[i], lastFile);
diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/Globals.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/Globals.java
index ad62c9735..22e52ec61 100644
--- a/testing/src/test/java/org/aspectj/testing/harness/bridge/Globals.java
+++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/Globals.java
@@ -71,7 +71,7 @@ public class Globals {
&& FileUtil.canReadFile(F_aspectjrt_jar)
&& FileUtil.canReadFile(J2SE13_RTJAR)
&& FileUtil.canReadFile(J2SE14_RTJAR));
- HashMap map = new HashMap();
+ Map map = new HashMap();
map.put("1.2", "java.lang.ref.Reference");
map.put("1.3", "java.lang.reflect.Proxy");
map.put("1.4", "java.nio.Buffer");
diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/IncCompilerRun.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/IncCompilerRun.java
index a0c48878e..e3bbb9209 100644
--- a/testing/src/test/java/org/aspectj/testing/harness/bridge/IncCompilerRun.java
+++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/IncCompilerRun.java
@@ -409,7 +409,7 @@ public class IncCompilerRun implements IAjcRun {
addItems(classesRemoved, items);
}
- private void addItems(ArrayList list, String items) {
+ private void addItems(List list, String items) {
if (null != items) {
String[] classes = XMLWriter.unflattenList(items);
if (!LangUtil.isEmpty(classes)) {
diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/Validator.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/Validator.java
index a0b4f5e96..1bda6adda 100644
--- a/testing/src/test/java/org/aspectj/testing/harness/bridge/Validator.java
+++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/Validator.java
@@ -13,12 +13,7 @@
package org.aspectj.testing.harness.bridge;
import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.ListIterator;
-import java.util.Stack;
+import java.util.*;
import org.aspectj.bridge.AbortException;
import org.aspectj.bridge.IMessage;
@@ -51,10 +46,10 @@ public class Validator {
private final Stack<IMessageHandler> handlers;
/** list of File registered for deletion on demand */
- private final ArrayList<File> tempFiles; // deleteTempFiles requires ListIterator.remove()
+ private final List<File> tempFiles; // deleteTempFiles requires ListIterator.remove()
/** list of Sandboxes registered for cleanup on demand */
- private final ArrayList<Sandbox> sandboxes;
+ private final List<Sandbox> sandboxes;
/** if true, throw AbortException on failure */
boolean abortOnFailure;
diff --git a/testing/src/test/java/org/aspectj/testing/run/RunListeners.java b/testing/src/test/java/org/aspectj/testing/run/RunListeners.java
index 4eb8e7a74..ebdc227d0 100644
--- a/testing/src/test/java/org/aspectj/testing/run/RunListeners.java
+++ b/testing/src/test/java/org/aspectj/testing/run/RunListeners.java
@@ -16,6 +16,7 @@ package org.aspectj.testing.run;
import java.util.ArrayList;
import java.util.Iterator;
+import java.util.List;
/**
* Aggregate listeners into one and run synchronously in order added.
@@ -23,7 +24,7 @@ import java.util.Iterator;
*/
public class RunListeners extends RunListener implements IRunListener {
- ArrayList listeners;
+ List listeners;
public RunListeners() {
listeners = new ArrayList();
}
diff --git a/testing/src/test/java/org/aspectj/testing/taskdefs/AjcTaskCompileCommandTest.java b/testing/src/test/java/org/aspectj/testing/taskdefs/AjcTaskCompileCommandTest.java
index 3871ee74b..b20a5650a 100644
--- a/testing/src/test/java/org/aspectj/testing/taskdefs/AjcTaskCompileCommandTest.java
+++ b/testing/src/test/java/org/aspectj/testing/taskdefs/AjcTaskCompileCommandTest.java
@@ -14,6 +14,7 @@ package org.aspectj.testing.taskdefs;
import java.io.File;
import java.util.ArrayList;
+import java.util.List;
import org.aspectj.bridge.IMessageHolder;
import org.aspectj.bridge.MessageHandler;
@@ -33,7 +34,7 @@ import junit.framework.TestCase;
public class AjcTaskCompileCommandTest extends TestCase {
static boolean loggedWarning = false;
static boolean runAllTests = true;
- static ArrayList<File> tempFiles = new ArrayList<>();
+ static List<File> tempFiles = new ArrayList<>();
private static File getClassesDir() {
File tempDir = FileUtil.getTempDir("AjcTaskCompileCommandTest-classes");
@@ -41,7 +42,7 @@ public class AjcTaskCompileCommandTest extends TestCase {
return tempDir;
}
- private static void addCommonArgs(ArrayList<String> list) {
+ private static void addCommonArgs(List<String> list) {
list.add("-d");
list.add(getClassesDir().getAbsolutePath());
list.add("-classpath");
diff --git a/testing/src/test/java/org/aspectj/testing/util/Diffs.java b/testing/src/test/java/org/aspectj/testing/util/Diffs.java
index e95ab3184..43739b752 100644
--- a/testing/src/test/java/org/aspectj/testing/util/Diffs.java
+++ b/testing/src/test/java/org/aspectj/testing/util/Diffs.java
@@ -148,8 +148,8 @@ public class Diffs {
IMessage[] actual,
IMessage.Kind[] ignoreExpectedKinds,
IMessage.Kind[] ignoreActualKinds) {
- ArrayList exp = getExcept(expected, ignoreExpectedKinds);
- ArrayList act = getExcept(actual, ignoreActualKinds);
+ List exp = getExcept(expected, ignoreExpectedKinds);
+ List act = getExcept(actual, ignoreActualKinds);
ArrayList missing = new ArrayList();
List unexpected = new ArrayList();
@@ -161,8 +161,8 @@ public class Diffs {
} else {
ListIterator expectedIterator = exp.listIterator();
int lastLine = Integer.MIN_VALUE + 1;
- ArrayList expectedFound = new ArrayList();
- ArrayList expectedForLine = new ArrayList();
+ List expectedFound = new ArrayList();
+ List expectedForLine = new ArrayList();
for (ListIterator iter = act.listIterator(); iter.hasNext();) {
IMessage actualMessage = (IMessage) iter.next();
int actualLine = getLine(actualMessage);
diff --git a/testing/src/test/java/org/aspectj/testing/util/FileUtil.java b/testing/src/test/java/org/aspectj/testing/util/FileUtil.java
index 71dfb7f2e..4f9f56424 100644
--- a/testing/src/test/java/org/aspectj/testing/util/FileUtil.java
+++ b/testing/src/test/java/org/aspectj/testing/util/FileUtil.java
@@ -25,12 +25,7 @@ import java.io.StringBufferInputStream;
import java.io.StringWriter;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.Vector;
+import java.util.*;
import java.util.jar.Attributes;
import java.util.jar.JarOutputStream;
import java.util.jar.Manifest;
@@ -131,7 +126,7 @@ public class FileUtil {
final boolean checkExpected = !LangUtil.isEmpty(expectedPaths);
// normalize sources to ignore
- final ArrayList expected = (!checkExpected ? null : new ArrayList());
+ final List expected = (!checkExpected ? null : new ArrayList());
if (checkExpected) {
for (String srcPath : expectedPaths) {
if (!LangUtil.isEmpty(srcPath)) {
@@ -186,7 +181,7 @@ public class FileUtil {
return false;
}
};
- ArrayList unexp = new ArrayList(Arrays.asList(dir.listFiles(touchedCollector)));
+ List unexp = new ArrayList(Arrays.asList(dir.listFiles(touchedCollector)));
// report any unexpected changes
return Diffs.makeDiffs(label, expected, unexp, String.CASE_INSENSITIVE_ORDER);
diff --git a/testing/src/test/java/org/aspectj/testing/util/LangUtil.java b/testing/src/test/java/org/aspectj/testing/util/LangUtil.java
index ad9331dd3..b4acc5ce3 100644
--- a/testing/src/test/java/org/aspectj/testing/util/LangUtil.java
+++ b/testing/src/test/java/org/aspectj/testing/util/LangUtil.java
@@ -402,7 +402,7 @@ public class LangUtil {
* @see Util#combine(Object[], Object[])
*/
public static String[] combine(String[] one, String[] two) {
- ArrayList twoList = new ArrayList(org.aspectj.util.LangUtil.arrayAsList(two));
+ List twoList = new ArrayList(org.aspectj.util.LangUtil.arrayAsList(two));
ArrayList result = new ArrayList();
if (null != one) {
for (String s : one) {
@@ -938,10 +938,10 @@ public class LangUtil {
return;
}
- ArrayList expected = new ArrayList(expectedListIn);
+ List expected = new ArrayList(expectedListIn);
expected.sort(comparator);
- ArrayList actual = new ArrayList(actualListIn);
+ List actual = new ArrayList(actualListIn);
actual.sort(comparator);
Iterator actualIter = actual.iterator();
Object act = null;
diff --git a/testing/src/test/java/org/aspectj/testing/util/LangUtilTest.java b/testing/src/test/java/org/aspectj/testing/util/LangUtilTest.java
index 6eede56a6..853e51f50 100644
--- a/testing/src/test/java/org/aspectj/testing/util/LangUtilTest.java
+++ b/testing/src/test/java/org/aspectj/testing/util/LangUtilTest.java
@@ -67,7 +67,7 @@ public class LangUtilTest extends TestCase {
void checkUnflatten(FTest test) {
String[] exp = test.unflattened;
- ArrayList result = LangUtil.unflatten(test.toUnflatten, test.spec);
+ List result = LangUtil.unflatten(test.toUnflatten, test.spec);
String label = test + " -> " + result;
assertNotNull(label, result);
@@ -96,7 +96,7 @@ public class LangUtilTest extends TestCase {
public void testArrayList() {
- ArrayList l = new ArrayList();
+ List l = new ArrayList();
l.add(null);
l.add(null);
assertTrue(null == l.get(0));
@@ -269,15 +269,15 @@ public class LangUtilTest extends TestCase {
if (unmodifiable) {
return Collections.unmodifiableList(Arrays.asList(ra));
} else {
- ArrayList list = new ArrayList(Arrays.asList(ra));
+ List list = new ArrayList(Arrays.asList(ra));
return list;
}
}
/** check both hard and soft - assuming list contain String */
void checkDiff(List expected, List actual, List missing, List extra) {
- ArrayList extraOut = new ArrayList();
- ArrayList missingOut = new ArrayList();
+ List extraOut = new ArrayList();
+ List missingOut = new ArrayList();
LangUtil.makeDiffs(expected, actual, missingOut, extraOut);
checkSame(missing, missingOut);
checkSame(extra, extraOut);
@@ -301,8 +301,8 @@ public class LangUtilTest extends TestCase {
/** check only soft - assuming list contain String */
void checkDiffSoft(List expected, List actual, List missing, List extra) {
- ArrayList extraOut = new ArrayList();
- ArrayList missingOut = new ArrayList();
+ List extraOut = new ArrayList();
+ List missingOut = new ArrayList();
LangUtil.makeSoftDiffs(expected, actual, missingOut, extraOut,
String.CASE_INSENSITIVE_ORDER);
checkSameSoft(missing, missingOut);
@@ -316,8 +316,8 @@ public class LangUtilTest extends TestCase {
String label = one + "?=" + two;
assertTrue(label, (null == one) == (null == two));
if (null != one) {
- ArrayList aone = new ArrayList(one);
- ArrayList atwo = new ArrayList();
+ List aone = new ArrayList(one);
+ List atwo = new ArrayList();
aone.addAll(two);
Collections.sort(aone);
Collections.sort(atwo);
diff --git a/testing/src/test/java/org/aspectj/testing/util/LinkCheck.java b/testing/src/test/java/org/aspectj/testing/util/LinkCheck.java
index a576c4ae4..17dff157e 100644
--- a/testing/src/test/java/org/aspectj/testing/util/LinkCheck.java
+++ b/testing/src/test/java/org/aspectj/testing/util/LinkCheck.java
@@ -171,10 +171,10 @@ public class LinkCheck {
private final Messages messages;
private final HTMLEditorKit.Parser parser; // XXX untested - stateful
- private final ArrayList<Link> linksToCheck;
- private final ArrayList<String> checkedUrls; // String (URL.toString)
- private final ArrayList<String> validRefs; // String (URL.toString)
- private final ArrayList<String> refsToCheck; // String (URL.toString)
+ private final List<Link> linksToCheck;
+ private final List<String> checkedUrls; // String (URL.toString)
+ private final List<String> validRefs; // String (URL.toString)
+ private final List<String> refsToCheck; // String (URL.toString)
private final Link.Check checkExists;
private final Link.Check checkContents;
@@ -221,7 +221,7 @@ public class LinkCheck {
}
public synchronized void run() {
- ArrayList<Link> list = new ArrayList<>();
+ List<Link> list = new ArrayList<>();
while (0 < linksToCheck.size()) {
messages.checkingLinks(linksToCheck.size());
list.clear();
diff --git a/testing/src/test/java/org/aspectj/testing/util/MessageUtilTest.java b/testing/src/test/java/org/aspectj/testing/util/MessageUtilTest.java
index abfff1ee6..9dc379d84 100644
--- a/testing/src/test/java/org/aspectj/testing/util/MessageUtilTest.java
+++ b/testing/src/test/java/org/aspectj/testing/util/MessageUtilTest.java
@@ -71,7 +71,7 @@ public class MessageUtilTest extends TestCase {
List getSampleMessageTexts() {
if (null == messageTexts) {
- ArrayList result = new ArrayList(Arrays.asList(new String[]
+ List result = new ArrayList(Arrays.asList(new String[]
{"one", "two", "now is the time for all good men..."}));
messageTexts = result;
}
@@ -80,7 +80,7 @@ public class MessageUtilTest extends TestCase {
List getSampleExceptions() {
if (null == exceptions) {
- ArrayList result = new ArrayList();
+ List result = new ArrayList();
int i = 1;
result.add(new Error("Error " + i++));
result.add(new RuntimeException("RuntimeException " + i++));
@@ -92,7 +92,7 @@ public class MessageUtilTest extends TestCase {
List getSampleLocations() {
if (null == locations) {
- ArrayList result = new ArrayList();
+ List result = new ArrayList();
File file = new File("testsrc/org/aspectj/testing/util/MessageUtilTest.java");
result.add(new SourceLocation(file, 1, 2, 1));
result.add(new SourceLocation(file, 100, 100, 0));
diff --git a/testing/src/test/java/org/aspectj/testing/util/TestClassLoader.java b/testing/src/test/java/org/aspectj/testing/util/TestClassLoader.java
index 8a753dfc7..559df2a0f 100644
--- a/testing/src/test/java/org/aspectj/testing/util/TestClassLoader.java
+++ b/testing/src/test/java/org/aspectj/testing/util/TestClassLoader.java
@@ -41,7 +41,7 @@ public class TestClassLoader extends URLClassLoader {
super(urls);
this.urlsForDebugString = urls;
LangUtil.throwIaxIfComponentsBad(dirs, "dirs", null);
- ArrayList dcopy = new ArrayList();
+ List dcopy = new ArrayList();
if (!LangUtil.isEmpty(dirs)) {
dcopy.addAll(Arrays.asList(dirs));
diff --git a/testing/src/test/java/org/aspectj/testing/util/TestDiffs.java b/testing/src/test/java/org/aspectj/testing/util/TestDiffs.java
index 11dd15587..09391bd6d 100644
--- a/testing/src/test/java/org/aspectj/testing/util/TestDiffs.java
+++ b/testing/src/test/java/org/aspectj/testing/util/TestDiffs.java
@@ -83,8 +83,8 @@ public class TestDiffs { // XXX pretty dumb implementation
Diffs tests = Diffs.makeDiffs("tests", exp, act, TestResult.BY_NAME);
// remove missing/unexpected (removed, added) tests from results
// otherwise, unexpected-[pass|fail] look like [fixes|broken]
- ArrayList expResults = trimByName(exp, tests.missing);
- ArrayList actResults = trimByName(act, tests.unexpected);
+ List expResults = trimByName(exp, tests.missing);
+ List actResults = trimByName(act, tests.unexpected);
Diffs results = Diffs.makeDiffs("results", expResults, actResults, TestResult.BY_PASSNAME);
@@ -159,7 +159,7 @@ public class TestDiffs { // XXX pretty dumb implementation
/** split input List by whether the TestResult element passed or failed */
- private static void split(List input, ArrayList pass, ArrayList fail) {
+ private static void split(List input, List pass, List fail) {
for (Object o : input) {
TestResult result = (TestResult) o;
if (result.pass) {
diff --git a/testing/src/test/java/org/aspectj/testing/util/TestDiffsTest.java b/testing/src/test/java/org/aspectj/testing/util/TestDiffsTest.java
index 17fa8234d..a0c5e115f 100644
--- a/testing/src/test/java/org/aspectj/testing/util/TestDiffsTest.java
+++ b/testing/src/test/java/org/aspectj/testing/util/TestDiffsTest.java
@@ -18,6 +18,7 @@ import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
+import java.util.List;
import java.util.ListIterator;
import org.aspectj.util.FileUtil;
@@ -67,7 +68,7 @@ public class TestDiffsTest extends TestCase {
}
}
- ArrayList tempFiles;
+ List tempFiles;
/**
* Constructor for FileUtilTest.
* @param arg0
diff --git a/testing/src/test/java/org/aspectj/testing/util/options/Option.java b/testing/src/test/java/org/aspectj/testing/util/options/Option.java
index b9c6d2cab..5d3ec4ba6 100644
--- a/testing/src/test/java/org/aspectj/testing/util/options/Option.java
+++ b/testing/src/test/java/org/aspectj/testing/util/options/Option.java
@@ -365,7 +365,7 @@ public class Option implements Comparable {
private final Map familyNameToFamily = new TreeMap();
/** enforce uniqueness of options */
- private final ArrayList names = new ArrayList();
+ private final List names = new ArrayList();
public Factory(String factoryName) {
this.factoryName = factoryName;
diff --git a/testing/src/test/java/org/aspectj/testing/util/options/Options.java b/testing/src/test/java/org/aspectj/testing/util/options/Options.java
index 92e84c106..03b3a6d51 100644
--- a/testing/src/test/java/org/aspectj/testing/util/options/Options.java
+++ b/testing/src/test/java/org/aspectj/testing/util/options/Options.java
@@ -14,6 +14,7 @@ package org.aspectj.testing.util.options;
import java.util.ArrayList;
import java.util.Iterator;
+import java.util.List;
import org.aspectj.util.LangUtil;
@@ -59,7 +60,7 @@ public class Options {
return sb.toString();
}
- private final ArrayList options = new ArrayList();
+ private final List options = new ArrayList();
private final boolean stopAtFirstMatch;
private boolean frozen = !FROZEN;
diff --git a/testing/src/test/java/org/aspectj/testing/xml/AjcSpecXmlReaderTest.java b/testing/src/test/java/org/aspectj/testing/xml/AjcSpecXmlReaderTest.java
index d6ebc774e..b60e56470 100644
--- a/testing/src/test/java/org/aspectj/testing/xml/AjcSpecXmlReaderTest.java
+++ b/testing/src/test/java/org/aspectj/testing/xml/AjcSpecXmlReaderTest.java
@@ -21,6 +21,7 @@ import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
+import java.util.List;
import org.aspectj.testing.harness.bridge.AjcSpecTest;
import org.aspectj.testing.harness.bridge.AjcTest;
@@ -35,7 +36,7 @@ import junit.framework.TestCase;
*/
public class AjcSpecXmlReaderTest extends TestCase {
- ArrayList<File> tempFiles = new ArrayList<>();
+ List<File> tempFiles = new ArrayList<>();
/**
* Constructor for AjcSpecXmlReaderTest.
* @param name
@@ -111,7 +112,7 @@ public class AjcSpecXmlReaderTest extends TestCase {
String xml2Path = path + ".tmp.xml";
final File file1 = new File(xmlPath);
- final ArrayList<File> toDelete = new ArrayList<>();
+ final List<File> toDelete = new ArrayList<>();
final AjcSpecXmlReader writer = AjcSpecXmlReader.getReader();
assertTrue("" + file1, file1.canRead());
@@ -154,7 +155,7 @@ public class AjcSpecXmlReaderTest extends TestCase {
AjcSpecXmlReader writer = AjcSpecXmlReader.getReader();
File file0 = new File(txtPath);
File file1 = new File(xmlPath);
- ArrayList<File> toDelete = new ArrayList<>();
+ List<File> toDelete = new ArrayList<>();
AjcTest.Suite.Spec suite0 = null;
if (file0.canRead()) {
System.out.println("reading " + file0);
diff --git a/testing/src/test/java/org/aspectj/testing/xml/MessageListXmlReaderTest.java b/testing/src/test/java/org/aspectj/testing/xml/MessageListXmlReaderTest.java
index 342484a76..3201d4288 100644
--- a/testing/src/test/java/org/aspectj/testing/xml/MessageListXmlReaderTest.java
+++ b/testing/src/test/java/org/aspectj/testing/xml/MessageListXmlReaderTest.java
@@ -16,6 +16,7 @@ package org.aspectj.testing.xml;
import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
+import java.util.List;
import org.aspectj.bridge.IMessage;
import org.aspectj.util.LangUtil;
@@ -27,7 +28,7 @@ import junit.framework.TestCase;
*/
public class MessageListXmlReaderTest extends TestCase {
- ArrayList tempFiles = new ArrayList();
+ List tempFiles = new ArrayList();
public MessageListXmlReaderTest(String name) {
super(name);
}
diff --git a/testing/src/test/java/org/aspectj/testing/xml/SoftMessage.java b/testing/src/test/java/org/aspectj/testing/xml/SoftMessage.java
index 969c8ecd8..8199e3826 100644
--- a/testing/src/test/java/org/aspectj/testing/xml/SoftMessage.java
+++ b/testing/src/test/java/org/aspectj/testing/xml/SoftMessage.java
@@ -41,7 +41,7 @@ public class SoftMessage implements IMessage {
private String details;
private int id;
private int sourceStart,sourceEnd;
- private final ArrayList extraSourceLocations = new ArrayList();
+ private final List extraSourceLocations = new ArrayList();
//private ISourceLocation pseudoSourceLocation; // set directly
// collapse enclosed source location for shorter, property-based xml