aboutsummaryrefslogtreecommitdiffstats
path: root/taskdefs
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 /taskdefs
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 'taskdefs')
-rw-r--r--taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java2
-rw-r--r--taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/Ajdoc.java20
-rw-r--r--taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/compilers/Ajc.java2
3 files changed, 12 insertions, 12 deletions
diff --git a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java
index 8a7c8a511..83dcd9911 100644
--- a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java
+++ b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java
@@ -719,7 +719,7 @@ public class AjcTask extends MatchingTask {
public CompilerArg createCompilerarg() {
CompilerArg compilerArg = new CompilerArg();
if (compilerArgs == null) {
- compilerArgs = new ArrayList<CompilerArg>();
+ compilerArgs = new ArrayList<>();
}
compilerArgs.add(compilerArg);
return compilerArg;
diff --git a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/Ajdoc.java b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/Ajdoc.java
index 194efaf22..8343027a7 100644
--- a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/Ajdoc.java
+++ b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/Ajdoc.java
@@ -74,7 +74,7 @@ public class Ajdoc extends MatchingTask {
private boolean fork;
private String source;
private Html bottom;
- private Vector<FileSet> fileSets = new Vector<FileSet>();
+ private Vector<FileSet> fileSets = new Vector<>();
/** reset all to initial values - permit gc if Ajdoc is held */
public Ajdoc() {
reset();
@@ -94,8 +94,8 @@ public class Ajdoc extends MatchingTask {
internalclasspath = null;
argfiles = null;
docletpath = null;
- links = new ArrayList<Link>();
- groups = new ArrayList<Group>();
+ links = new ArrayList<>();
+ groups = new ArrayList<>();
doclet = null;
failonerror = false;
fork = false;
@@ -165,7 +165,7 @@ public class Ajdoc extends MatchingTask {
private void addFileSets() {
if(sourcefiles == null)
- sourcefiles = new ArrayList<String>();
+ sourcefiles = new ArrayList<>();
Enumeration<FileSet> e = fileSets.elements();
while (e.hasMoreElements()) {
@@ -186,7 +186,7 @@ public class Ajdoc extends MatchingTask {
public void setPackagenames(String list) {
(packagenames == null ?
- packagenames = new ArrayList<String>() :
+ packagenames = new ArrayList<>() :
packagenames).addAll(strings(list, true));
}
@@ -264,7 +264,7 @@ public class Ajdoc extends MatchingTask {
public List<File> createArgfiles() {
return (argfiles == null ?
- argfiles = new ArrayList<File>() :
+ argfiles = new ArrayList<>() :
argfiles);
}
@@ -480,7 +480,7 @@ public class Ajdoc extends MatchingTask {
public class Doclet {
protected String name;
protected Path path;
- protected List<Param> params = new ArrayList<Param>();
+ protected List<Param> params = new ArrayList<>();
public Doclet() {}
public void setName(String name) {
this.name = name;
@@ -617,7 +617,7 @@ public class Ajdoc extends MatchingTask {
}
}
}
- Map<String,List<String>> groupMap = new HashMap<String,List<String>>();
+ Map<String,List<String>> groupMap = new HashMap<>();
for (Group group: groups) {
if (group.title == null) {
throw new BuildException("Group names cannot be null!",
@@ -629,7 +629,7 @@ public class Ajdoc extends MatchingTask {
}
List<String> packages = groupMap.get(group.title);
if (packages == null) {
- packages = new ArrayList<String>();
+ packages = new ArrayList<>();
}
packages.addAll(group.packages);
groupMap.put(group.title, packages);
@@ -719,7 +719,7 @@ public class Ajdoc extends MatchingTask {
protected final <T> List<T> list(String str, Mapper<T> mapper) {
if (str == null) return Collections.emptyList();
- List<T> list = new ArrayList<T>();
+ List<T> list = new ArrayList<>();
for (StringTokenizer t = new StringTokenizer(str, ",", false);
t.hasMoreTokens();) {
list.add(mapper.map(t.nextToken().trim()));
diff --git a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/compilers/Ajc.java b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/compilers/Ajc.java
index 2516a2ac5..022dcae22 100644
--- a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/compilers/Ajc.java
+++ b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/compilers/Ajc.java
@@ -53,7 +53,7 @@ public class Ajc extends DefaultCompilerAdapter {
"-encoding", "-target" });
private static List<String> finalList(String[] args) {
- List<String> result = new ArrayList<String>();
+ List<String> result = new ArrayList<>();
result.addAll(Arrays.asList(args));
return Collections.unmodifiableList(result);
}