aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorLars Grefer <eclipse@larsgrefer.de>2020-08-13 01:01:58 +0200
committerLars Grefer <eclipse@larsgrefer.de>2020-08-13 01:01:58 +0200
commite1bff9a5703baf17ec650b173bdfe776bf87125f (patch)
tree8b4443759c231a6c46cb70c755fe554a4b621e11 /build
parentb6eee2e1052116aa22ebbd3c2baf05c2b709bee5 (diff)
downloadaspectj-e1bff9a5703baf17ec650b173bdfe776bf87125f.tar.gz
aspectj-e1bff9a5703baf17ec650b173bdfe776bf87125f.zip
Use the diamond operator where possible
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
Diffstat (limited to 'build')
-rw-r--r--build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java4
-rw-r--r--build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/Checklics.java6
-rw-r--r--build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/ConditionalTask.java4
-rw-r--r--build/src/main/java/org/aspectj/internal/tools/build/Builder.java10
-rw-r--r--build/src/main/java/org/aspectj/internal/tools/build/Module.java14
-rw-r--r--build/src/main/java/org/aspectj/internal/tools/build/Modules.java2
-rw-r--r--build/src/main/java/org/aspectj/internal/tools/build/Result.java14
-rw-r--r--build/src/main/java/org/aspectj/internal/tools/build/SampleGatherer.java6
-rw-r--r--build/src/test/java/org/aspectj/build/BuildModuleTests.java8
-rw-r--r--build/src/test/java/org/aspectj/internal/build/BuildModuleTest.java4
-rw-r--r--build/src/test/java/org/aspectj/internal/build/ModulesTest.java4
11 files changed, 38 insertions, 38 deletions
diff --git a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java
index 12286748e..91506e439 100644
--- a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java
+++ b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java
@@ -409,7 +409,7 @@ public class AntBuilder extends Builder {
*/
@Override
protected Result[] getAntecedantResults(Result moduleResult) {
- Hashtable<String,Target> targets = new Hashtable<String, Target>();
+ Hashtable<String,Target> targets = new Hashtable<>();
makeTargetsForResult(moduleResult, targets);
String targetName = resultToTargetName(moduleResult);
// bug: doc says topoSort returns String, but returns Target
@@ -419,7 +419,7 @@ public class AntBuilder extends Builder {
if (0 == result.size()) {
return new Result[0];
}
- ArrayList<String> toReturn = new ArrayList<String>();
+ ArrayList<String> toReturn = new ArrayList<>();
for (Target target : result) {
String name = target.getName();
if (null == name) {
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 aa0c35e35..ed64e74e0 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
@@ -83,7 +83,7 @@ public class Checklics extends MatchingTask {
License MPL_ONLY = new License(MPL_ONLY_TAG, LIC_MPL);
License MPL_PARC = new License(MPL_PARC_TAG, LIC_MPL, PARC);
License PARC_COPYRIGHT = new License(PARC_COPYRIGHT_TAG, null, PARC);
- LICENSES = new Hashtable<String,License>();
+ LICENSES = new Hashtable<>();
LICENSES.put(APL.tag, APL);
LICENSES.put(MPL.tag, MPL);
LICENSES.put(MPL_PARC.tag, MPL_PARC);
@@ -469,7 +469,7 @@ class HeaderInfo {
this.lastLine = lastLine;
this.file = file;
this.hasLicense = hasLicense;
- List<String> newYears = new ArrayList<String>();
+ List<String> newYears = new ArrayList<>();
newYears.addAll(years);
Collections.sort(newYears);
this.years = Collections.unmodifiableList(newYears);
@@ -618,7 +618,7 @@ class Header {
}
public static HeaderInfo checkFile(final File file) {
- ArrayList<String> years = new ArrayList<String>();
+ ArrayList<String> years = new ArrayList<>();
int endLine = 0;
BufferedReader input = null;
int lineNum = 0;
diff --git a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/ConditionalTask.java b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/ConditionalTask.java
index e71795912..431f9b25b 100644
--- a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/ConditionalTask.java
+++ b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/ConditionalTask.java
@@ -28,7 +28,7 @@ public abstract class ConditionalTask extends Task {
private List<If> ifs;
protected List<If> ifs() {
- return ifs != null ? ifs : (ifs = new Vector<If>());
+ return ifs != null ? ifs : (ifs = new Vector<>());
}
public If createIf() {
@@ -169,7 +169,7 @@ public abstract class ConditionalTask extends Task {
protected List<String> getFalses() {
Iterator<If> iter = ifs().iterator();
- List<String> result = new Vector<String>();
+ List<String> result = new Vector<>();
while (iter.hasNext()) {
If next = iter.next();
String name = next.getName();
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 fe80190ad..ac13870c8 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
@@ -149,7 +149,7 @@ public abstract class Builder {
if ((null == text) || (0 == text.length())) {
return Collections.EMPTY_LIST;
}
- List<String> strings = new ArrayList<String>();
+ List<String> strings = new ArrayList<>();
StringTokenizer tok = new StringTokenizer(text, ",");
while (tok.hasMoreTokens()) {
String token = tok.nextToken().trim();
@@ -275,7 +275,7 @@ public abstract class Builder {
return buildProduct(buildSpec);
}
Result result = specifyResultFor(buildSpec);
- ArrayList<String> errors = new ArrayList<String>();
+ ArrayList<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<String>();
+ ArrayList<String> doneList = new ArrayList<>();
if ((null != buildList) && (0 < buildList.length)) {
if (isLogging()) {
handler.log("modules to build: " + Arrays.asList(buildList));
@@ -543,7 +543,7 @@ public abstract class Builder {
* deliverables.
*/
protected ProductModule[] discoverModules(File productDir, Modules modules) {
- final ArrayList<File> found = new ArrayList<File>();
+ final ArrayList<File> found = new ArrayList<>();
FileFilter filter = new FileFilter() {// empty jar files
public boolean accept(File file) {
if ((null != file) && file.canRead()
@@ -555,7 +555,7 @@ public abstract class Builder {
}
};
Util.visitFiles(productDir, filter);
- ArrayList<ProductModule> results = new ArrayList<ProductModule>();
+ ArrayList<ProductModule> results = new ArrayList<>();
for (File file: found) {
String jarName = moduleAliasFor(file.getName().toLowerCase());
if (jarName.endsWith(".jar") || jarName.endsWith(".zip")) { // XXXFileLiteral
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 65d929707..3f34b3f5e 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<File>();
+ ArrayList<File> result = new ArrayList<>();
sourceFiles(srcDir, result);
return result.iterator();
}
@@ -198,11 +198,11 @@ public class Module {
Util.iaxIfNull(name, "name");
Util.iaxIfNull(modules, "modules");
this.moduleDir = moduleDir;
- this.libJars = new ArrayList<File>();
- this.exportedLibJars = new ArrayList<File>();
- this.requiredModules = new ArrayList<Module>();
- this.srcDirs = new ArrayList<File>();
- this.classpathVariables = new ArrayList<String>();
+ this.libJars = new ArrayList<>();
+ this.exportedLibJars = new ArrayList<>();
+ this.requiredModules = new ArrayList<>();
+ this.srcDirs = new ArrayList<>();
+ this.classpathVariables = new ArrayList<>();
this.properties = new Properties();
this.name = name;
this.modules = modules;
@@ -609,7 +609,7 @@ public class Module {
String[] tokenize(String line) {
final String DELIM = " \n\t\\<>\"=";
StringTokenizer st = new StringTokenizer(line, DELIM, true);
- ArrayList<String> result = new ArrayList<String>();
+ ArrayList<String> result = new ArrayList<>();
StringBuffer quote = new StringBuffer();
boolean inQuote = false;
while (st.hasMoreTokens()) {
diff --git a/build/src/main/java/org/aspectj/internal/tools/build/Modules.java b/build/src/main/java/org/aspectj/internal/tools/build/Modules.java
index 83686820e..ca2b50aac 100644
--- a/build/src/main/java/org/aspectj/internal/tools/build/Modules.java
+++ b/build/src/main/java/org/aspectj/internal/tools/build/Modules.java
@@ -24,7 +24,7 @@ import java.util.Hashtable;
*/
public class Modules {
- private final Hashtable<String,Module> modules = new Hashtable<String,Module>();
+ private final Hashtable<String,Module> modules = new Hashtable<>();
public final File baseDir;
public final File jarDir;
private final Messager handler;
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 b17ac656e..563a6932e 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
@@ -38,7 +38,7 @@ public class Result {
private static final Kind[] KINDS = { RELEASE, TEST, RELEASE_ALL, TEST_ALL };
- private static final HashMap<String,Result> nameToResult = new HashMap<String, Result>();
+ private static final HashMap<String,Result> nameToResult = new HashMap<>();
public static boolean isTestingJar(String name) {
name = name.toLowerCase();
@@ -177,11 +177,11 @@ public class Result {
Result(Kind kind, Module module, File jarDir) {
this.kind = kind;
this.module = module;
- this.libJars = new ArrayList<File>();
- this.exportedLibJars = new ArrayList<File>();
- this.srcDirs = new ArrayList<File>();
- this.classpathVariables = new ArrayList<String>();
- this.requiredResults = new ArrayList<Result>();
+ this.libJars = new ArrayList<>();
+ this.exportedLibJars = new ArrayList<>();
+ this.srcDirs = new ArrayList<>();
+ this.classpathVariables = new ArrayList<>();
+ this.requiredResults = new ArrayList<>();
String name = module.name;
if (!kind.normal) {
name += "-test";
@@ -217,7 +217,7 @@ public class Result {
/** @return List (File) of jar's required */
public List<File> findJarRequirements() {
- ArrayList<File> result = new ArrayList<File>();
+ ArrayList<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 4df90dbbe..ca041b33d 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
@@ -404,7 +404,7 @@ class Sample {
* type-safe Collection of samples.
*/
class Samples {
- private ArrayList<Sample> samples = new ArrayList<Sample>();
+ private ArrayList<Sample> samples = new ArrayList<>();
int size() {
return samples.size();
}
@@ -419,7 +419,7 @@ class Samples {
}
List<Sample> getSortedSamples(Comparator<Sample> comparer) {
- ArrayList<Sample> result = new ArrayList<Sample>();
+ ArrayList<Sample> result = new ArrayList<>();
result.addAll(samples);
Collections.sort(result, comparer);
return result;
@@ -966,7 +966,7 @@ class SampleUtil {
}
public static String[] splitAnchorName(String anchorName) {
- ArrayList<String> result = new ArrayList<String>();
+ ArrayList<String> result = new ArrayList<>();
int start = 0;
int loc = anchorName.indexOf("-", start);
String next;
diff --git a/build/src/test/java/org/aspectj/build/BuildModuleTests.java b/build/src/test/java/org/aspectj/build/BuildModuleTests.java
index 042548d3f..f4aaa5708 100644
--- a/build/src/test/java/org/aspectj/build/BuildModuleTests.java
+++ b/build/src/test/java/org/aspectj/build/BuildModuleTests.java
@@ -69,7 +69,7 @@ public class BuildModuleTests extends TestCase {
* @return
*/
private static File[] findSourceRoots(File moduleDir) {
- ArrayList<File> result = new ArrayList<File>();
+ ArrayList<File> result = new ArrayList<>();
for (String name: SOURCE_NAMES) {
File srcDir = new File(moduleDir, name);
if (srcDir.canRead() && srcDir.isDirectory()) {
@@ -198,7 +198,7 @@ public class BuildModuleTests extends TestCase {
// separate check to verify all file types (suffixes) are known
if (!isTestFolder(srcDir)) {
- ArrayList<File> unknownFiles = new ArrayList<File>();
+ ArrayList<File> unknownFiles = new ArrayList<>();
UnknownFileCheck.SINGLETON.unknownFiles(srcDir, unknownFiles);
System.out.println(unknownFiles);
if (!unknownFiles.isEmpty()) {
@@ -225,12 +225,12 @@ 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<String>();
+ private static final ArrayList<String> STATIC_ERRORS = new ArrayList<>();
// Builder.BINARY_SOURCE_PATTERN and Builder.RESOURCE_PATTERN
public static final List<String> KNOWN_SUFFIXES;
static {
- List<String> suffixes = new ArrayList<String>();
+ List<String> suffixes = new ArrayList<>();
// sources from org.aspectj.util.FileUtil.SOURCE_SUFFIXES
suffixes.add(".aj");
suffixes.add(".java");
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 81600ca94..7693ddb11 100644
--- a/build/src/test/java/org/aspectj/internal/build/BuildModuleTest.java
+++ b/build/src/test/java/org/aspectj/internal/build/BuildModuleTest.java
@@ -80,7 +80,7 @@ public class BuildModuleTest extends TestCase {
}
}
- ArrayList<File> tempFiles = new ArrayList<File>();
+ ArrayList<File> tempFiles = new ArrayList<>();
private File jarDir;
private boolean deleteJars;
boolean building; // must be enabled for tests to run
@@ -343,7 +343,7 @@ public class BuildModuleTest extends TestCase {
try {
zipFile = new ZipFile(weaverAllJar);
Enumeration e = zipFile.entries();
- ArrayList<String> entryNames = new ArrayList<String>();
+ ArrayList<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 383b3859d..494084e0c 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<File>();
+ ArrayList<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<Module>();
+ ArrayList<Module> badModules = new ArrayList<>();
for (String name: MODULE_NAMES) {
File dir = new File(BASE_DIR, name);
if (dir.isDirectory()) {