From 2409bcbc7c9606b055e23f52d688eecda84351d6 Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Sat, 15 Aug 2020 16:33:00 +0200 Subject: 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 --- util/src/test/java/org/aspectj/util/FileUtilTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'util/src/test') diff --git a/util/src/test/java/org/aspectj/util/FileUtilTest.java b/util/src/test/java/org/aspectj/util/FileUtilTest.java index 7936914fb..f5466e2cf 100644 --- a/util/src/test/java/org/aspectj/util/FileUtilTest.java +++ b/util/src/test/java/org/aspectj/util/FileUtilTest.java @@ -508,8 +508,7 @@ public class FileUtilTest extends TestCase { errors.add(error); } }; - List sourceList = new ArrayList<>(); - sourceList.addAll(Arrays.asList(sources)); + List sourceList = new ArrayList<>(Arrays.asList(sources)); sourceList = Collections.unmodifiableList(sourceList); for (int k = 0; k < sources.length; k++) { List result = FileUtil.lineSeek("" + k, sourceList, true, errorSink); -- cgit v1.2.3