From e1bff9a5703baf17ec650b173bdfe776bf87125f Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Thu, 13 Aug 2020 01:01:58 +0200 Subject: Use the diamond operator where possible Signed-off-by: Lars Grefer --- .../java/org/aspectj/tools/ant/taskdefs/AjcTask.java | 2 +- .../java/org/aspectj/tools/ant/taskdefs/Ajdoc.java | 20 ++++++++++---------- .../aspectj/tools/ant/taskdefs/compilers/Ajc.java | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'taskdefs/src/main') 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(); + 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 fileSets = new Vector(); + private Vector 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(); - groups = new ArrayList(); + 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(); + sourcefiles = new ArrayList<>(); Enumeration 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() : + packagenames = new ArrayList<>() : packagenames).addAll(strings(list, true)); } @@ -264,7 +264,7 @@ public class Ajdoc extends MatchingTask { public List createArgfiles() { return (argfiles == null ? - argfiles = new ArrayList() : + argfiles = new ArrayList<>() : argfiles); } @@ -480,7 +480,7 @@ public class Ajdoc extends MatchingTask { public class Doclet { protected String name; protected Path path; - protected List params = new ArrayList(); + protected List params = new ArrayList<>(); public Doclet() {} public void setName(String name) { this.name = name; @@ -617,7 +617,7 @@ public class Ajdoc extends MatchingTask { } } } - Map> groupMap = new HashMap>(); + Map> 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 packages = groupMap.get(group.title); if (packages == null) { - packages = new ArrayList(); + packages = new ArrayList<>(); } packages.addAll(group.packages); groupMap.put(group.title, packages); @@ -719,7 +719,7 @@ public class Ajdoc extends MatchingTask { protected final List list(String str, Mapper mapper) { if (str == null) return Collections.emptyList(); - List list = new ArrayList(); + List 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 finalList(String[] args) { - List result = new ArrayList(); + List result = new ArrayList<>(); result.addAll(Arrays.asList(args)); return Collections.unmodifiableList(result); } -- cgit v1.2.3