From 639f5030e0391e831138f9786cf831c3374449e7 Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Sat, 15 Aug 2020 17:01:46 +0200 Subject: 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 --- build/src/test/java/org/aspectj/build/BuildModuleTests.java | 2 +- .../test/java/org/aspectj/internal/build/BuildModuleTest.java | 9 +++------ build/src/test/java/org/aspectj/internal/build/ModulesTest.java | 4 ++-- 3 files changed, 6 insertions(+), 9 deletions(-) (limited to 'build/src/test/java/org') diff --git a/build/src/test/java/org/aspectj/build/BuildModuleTests.java b/build/src/test/java/org/aspectj/build/BuildModuleTests.java index f4aaa5708..46f5b15a0 100644 --- a/build/src/test/java/org/aspectj/build/BuildModuleTests.java +++ b/build/src/test/java/org/aspectj/build/BuildModuleTests.java @@ -225,7 +225,7 @@ public class BuildModuleTests extends TestCase { */ static class UnknownFileCheck implements FileFilter { private static final UnknownFileCheck SINGLETON = new UnknownFileCheck(); - private static final ArrayList STATIC_ERRORS = new ArrayList<>(); + private static final List STATIC_ERRORS = new ArrayList<>(); // Builder.BINARY_SOURCE_PATTERN and Builder.RESOURCE_PATTERN public static final List KNOWN_SUFFIXES; diff --git a/build/src/test/java/org/aspectj/internal/build/BuildModuleTest.java b/build/src/test/java/org/aspectj/internal/build/BuildModuleTest.java index 7693ddb11..33dac2a0a 100644 --- a/build/src/test/java/org/aspectj/internal/build/BuildModuleTest.java +++ b/build/src/test/java/org/aspectj/internal/build/BuildModuleTest.java @@ -16,10 +16,7 @@ package org.aspectj.internal.build; import java.io.File; import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Enumeration; -import java.util.Iterator; +import java.util.*; import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; @@ -80,7 +77,7 @@ public class BuildModuleTest extends TestCase { } } - ArrayList tempFiles = new ArrayList<>(); + List tempFiles = new ArrayList<>(); private File jarDir; private boolean deleteJars; boolean building; // must be enabled for tests to run @@ -343,7 +340,7 @@ public class BuildModuleTest extends TestCase { try { zipFile = new ZipFile(weaverAllJar); Enumeration e = zipFile.entries(); - ArrayList entryNames = new ArrayList<>(); + List entryNames = new ArrayList<>(); while (e.hasMoreElements()) { ZipEntry entry = (ZipEntry) e.nextElement(); String name = entry.getName(); diff --git a/build/src/test/java/org/aspectj/internal/build/ModulesTest.java b/build/src/test/java/org/aspectj/internal/build/ModulesTest.java index 494084e0c..6273556a5 100644 --- a/build/src/test/java/org/aspectj/internal/build/ModulesTest.java +++ b/build/src/test/java/org/aspectj/internal/build/ModulesTest.java @@ -72,7 +72,7 @@ public class ModulesTest extends TestCase { } } - ArrayList tempFiles = new ArrayList<>(); + List tempFiles = new ArrayList<>(); public ModulesTest(String name) { super(name); @@ -101,7 +101,7 @@ public class ModulesTest extends TestCase { } public void testAllModulesCreation() { - ArrayList badModules = new ArrayList<>(); + List badModules = new ArrayList<>(); for (String name: MODULE_NAMES) { File dir = new File(BASE_DIR, name); if (dir.isDirectory()) { -- cgit v1.2.3