diff options
author | Lars Grefer <eclipse@larsgrefer.de> | 2020-08-15 17:01:46 +0200 |
---|---|---|
committer | Lars Grefer <eclipse@larsgrefer.de> | 2020-08-15 17:01:46 +0200 |
commit | 639f5030e0391e831138f9786cf831c3374449e7 (patch) | |
tree | fc4e616cb6df8e73722a6d0cf83a55efd6d87387 /build | |
parent | 2409bcbc7c9606b055e23f52d688eecda84351d6 (diff) | |
download | aspectj-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 'build')
9 files changed, 16 insertions, 19 deletions
diff --git a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/Checklics.java b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/Checklics.java index 5d592243c..e343c9d48 100644 --- a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/Checklics.java +++ b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/Checklics.java @@ -654,7 +654,7 @@ class Header { * * @return true if this line has end-of-comment */ - private static boolean checkLine(String line, ArrayList<String> years) { + private static boolean checkLine(String line, List<String> years) { if ((null == line) || (0 == line.length())) { return false; } diff --git a/build/src/main/java/org/aspectj/internal/tools/build/Builder.java b/build/src/main/java/org/aspectj/internal/tools/build/Builder.java index ac13870c8..fad8b560a 100644 --- a/build/src/main/java/org/aspectj/internal/tools/build/Builder.java +++ b/build/src/main/java/org/aspectj/internal/tools/build/Builder.java @@ -181,7 +181,7 @@ public abstract class Builder { private final File tempDir; - private final ArrayList tempFiles; + private final List tempFiles; private final boolean useEclipseCompiles; @@ -275,7 +275,7 @@ public abstract class Builder { return buildProduct(buildSpec); } Result result = specifyResultFor(buildSpec); - ArrayList<String> errors = new ArrayList<>(); + List<String> errors = new ArrayList<>(); try { return buildAll(result, errors); } finally { @@ -340,7 +340,7 @@ public abstract class Builder { */ protected final boolean buildAll(Result result, List<String> errors) { Result[] buildList = skipUptodate(getAntecedantResults(result)); - ArrayList<String> doneList = new ArrayList<>(); + List<String> doneList = new ArrayList<>(); if ((null != buildList) && (0 < buildList.length)) { if (isLogging()) { handler.log("modules to build: " + Arrays.asList(buildList)); @@ -525,7 +525,7 @@ public abstract class Builder { } protected final boolean buildProductModule(ProductModule module) { - ArrayList<String> errors = new ArrayList<>(); + List<String> errors = new ArrayList<>(); try { Kind productKind = Result.kind(Result.NORMAL, Result.ASSEMBLE); Result result = module.module.getResult(productKind); @@ -543,7 +543,7 @@ public abstract class Builder { * deliverables. */ protected ProductModule[] discoverModules(File productDir, Modules modules) { - final ArrayList<File> found = new ArrayList<>(); + final List<File> found = new ArrayList<>(); FileFilter filter = new FileFilter() {// empty jar files public boolean accept(File file) { if ((null != file) && file.canRead() diff --git a/build/src/main/java/org/aspectj/internal/tools/build/Module.java b/build/src/main/java/org/aspectj/internal/tools/build/Module.java index 3f34b3f5e..9d10e4743 100644 --- a/build/src/main/java/org/aspectj/internal/tools/build/Module.java +++ b/build/src/main/java/org/aspectj/internal/tools/build/Module.java @@ -69,7 +69,7 @@ public class Module { /** @return all source files under srcDir */ private static Iterator<File> sourceFiles(File srcDir) { - ArrayList<File> result = new ArrayList<>(); + List<File> result = new ArrayList<>(); sourceFiles(srcDir, result); return result.iterator(); } diff --git a/build/src/main/java/org/aspectj/internal/tools/build/Result.java b/build/src/main/java/org/aspectj/internal/tools/build/Result.java index 563a6932e..22b92c8af 100644 --- a/build/src/main/java/org/aspectj/internal/tools/build/Result.java +++ b/build/src/main/java/org/aspectj/internal/tools/build/Result.java @@ -217,7 +217,7 @@ public class Result { /** @return List (File) of jar's required */ public List<File> findJarRequirements() { - ArrayList<File> result = new ArrayList<>(); + List<File> result = new ArrayList<>(); Module.doFindJarRequirements(this, result); return result; } diff --git a/build/src/main/java/org/aspectj/internal/tools/build/SampleGatherer.java b/build/src/main/java/org/aspectj/internal/tools/build/SampleGatherer.java index bf9b9aab9..9030bbf77 100644 --- a/build/src/main/java/org/aspectj/internal/tools/build/SampleGatherer.java +++ b/build/src/main/java/org/aspectj/internal/tools/build/SampleGatherer.java @@ -419,7 +419,7 @@ class Samples { } List<Sample> getSortedSamples(Comparator<Sample> comparer) { - ArrayList<Sample> result = new ArrayList<>(samples); + List<Sample> result = new ArrayList<>(samples); result.sort(comparer); return result; } diff --git a/build/src/main/java/org/aspectj/internal/tools/build/Util.java b/build/src/main/java/org/aspectj/internal/tools/build/Util.java index dd393ce45..cd7d6623f 100644 --- a/build/src/main/java/org/aspectj/internal/tools/build/Util.java +++ b/build/src/main/java/org/aspectj/internal/tools/build/Util.java @@ -357,7 +357,7 @@ public class Util { /** unmodifiable list of all valid OSGIBundle Name's */ public static final List<Name> NAMES; static { - ArrayList<Name> names = new ArrayList<>(); + List<Name> names = new ArrayList<>(); names.add(BUNDLE_NAME); names.add(BUNDLE_SYMBOLIC_NAME); names.add(BUNDLE_VERSION); 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<String> STATIC_ERRORS = new ArrayList<>(); + private static final List<String> STATIC_ERRORS = new ArrayList<>(); // Builder.BINARY_SOURCE_PATTERN and Builder.RESOURCE_PATTERN public static final List<String> 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<File> tempFiles = new ArrayList<>(); + List<File> 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<String> entryNames = new ArrayList<>(); + List<String> 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<File> tempFiles = new ArrayList<>(); + List<File> tempFiles = new ArrayList<>(); public ModulesTest(String name) { super(name); @@ -101,7 +101,7 @@ public class ModulesTest extends TestCase { } public void testAllModulesCreation() { - ArrayList<Module> badModules = new ArrayList<>(); + List<Module> badModules = new ArrayList<>(); for (String name: MODULE_NAMES) { File dir = new File(BASE_DIR, name); if (dir.isDirectory()) { |