diff options
Diffstat (limited to 'build')
9 files changed, 20 insertions, 24 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 ed64e74e0..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 @@ -469,8 +469,7 @@ class HeaderInfo { this.lastLine = lastLine; this.file = file; this.hasLicense = hasLicense; - List<String> newYears = new ArrayList<>(); - newYears.addAll(years); + List<String> newYears = new ArrayList<>(years); Collections.sort(newYears); this.years = Collections.unmodifiableList(newYears); if ((null == file) || !file.canWrite()) { @@ -655,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 1ef07a214..b43578dd3 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 @@ -180,7 +180,7 @@ public abstract class Builder { private final File tempDir; - private final ArrayList tempFiles; + private final List tempFiles; private final boolean useEclipseCompiles; @@ -274,7 +274,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 { @@ -339,7 +339,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)); @@ -524,7 +524,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); @@ -542,7 +542,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 2bc423d8b..2864bb92f 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 @@ -219,7 +219,7 @@ public class SampleGatherer { source, startLine, endLine, - flags.toArray(new String[flags.size()])); + flags.toArray(new String[0])); sink.addSample(sample); // back to seeking start @@ -417,9 +417,8 @@ class Samples { } List<Sample> getSortedSamples(Comparator<Sample> comparer) { - ArrayList<Sample> result = new ArrayList<>(); - result.addAll(samples); - Collections.sort(result, comparer); + List<Sample> result = new ArrayList<>(samples); + result.sort(comparer); return result; } } @@ -976,7 +975,7 @@ class SampleUtil { } next = anchorName.substring(start); result.add(next); - return result.toArray(new String[result.size()]); + return result.toArray(new String[0]); } /** * Replace literals with literals in source string 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 852f9953a..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,9 +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.*; import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; @@ -79,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 @@ -342,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 e93f94f35..ce6d77d78 100644 --- a/build/src/test/java/org/aspectj/internal/build/ModulesTest.java +++ b/build/src/test/java/org/aspectj/internal/build/ModulesTest.java @@ -71,7 +71,7 @@ public class ModulesTest extends TestCase { } } - ArrayList<File> tempFiles = new ArrayList<>(); + List<File> tempFiles = new ArrayList<>(); public ModulesTest(String name) { super(name); @@ -100,7 +100,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()) { |