aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
authorLars Grefer <eclipse@larsgrefer.de>2020-08-15 16:33:00 +0200
committerLars Grefer <eclipse@larsgrefer.de>2020-08-15 16:36:00 +0200
commit2409bcbc7c9606b055e23f52d688eecda84351d6 (patch)
treee775e9d0e033ec563236c31623f66d023c40aac5 /tests/src
parent3641f1626df6b9b1c11dd3f16b01a01495f4662d (diff)
downloadaspectj-2409bcbc7c9606b055e23f52d688eecda84351d6.tar.gz
aspectj-2409bcbc7c9606b055e23f52d688eecda84351d6.zip
Redundant Collection.addAll() call
Reports Collection.addAll() and Map.putAll() calls after instantiation of a collection using a constructor call without arguments. Such constructs can be replaced with a single call to a parametrized constructor which simplifies code. Also for some collections the replacement might be more performant. Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/model/ModelTestCase.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/src/test/java/org/aspectj/systemtest/model/ModelTestCase.java b/tests/src/test/java/org/aspectj/systemtest/model/ModelTestCase.java
index b18d9a5f7..550ff759a 100644
--- a/tests/src/test/java/org/aspectj/systemtest/model/ModelTestCase.java
+++ b/tests/src/test/java/org/aspectj/systemtest/model/ModelTestCase.java
@@ -143,8 +143,7 @@ public abstract class ModelTestCase extends XMLBasedAjcTestCase {
while ((expectedLine = expect.readLine()) != null) {
fileContents.add(expectedLine);
}
- List<String> expectedFileContents = new ArrayList<>();
- expectedFileContents.addAll(fileContents);
+ List<String> expectedFileContents = new ArrayList<>(fileContents);
// Load the file with the output from this test run
BufferedReader found = new BufferedReader(new FileReader(new File(modelOutput)));