Update 'taskdefs' code to use genericstags/V1_9_9
@@ -63,7 +63,7 @@ public class Ajc10 extends MatchingTask { | |||
private Path bootclasspath; | |||
private Path extdirs; | |||
private Path srcdir; | |||
private List argfiles; | |||
private List<File> argfiles; | |||
private boolean fork; | |||
private boolean failonerror; | |||
private boolean verbose; | |||
@@ -197,7 +197,7 @@ public class Ajc10 extends MatchingTask { | |||
public void setArgfile(File argfile) { // ajc-only eajc-also docDone | |||
if (argfiles == null) { | |||
argfiles = new Vector(); | |||
argfiles = new Vector<>(); | |||
} | |||
argfiles.add(argfile); | |||
} | |||
@@ -205,7 +205,7 @@ public class Ajc10 extends MatchingTask { | |||
public void setArgfiles(String argfiles) { // ajc-only eajc-also docDone | |||
StringTokenizer tok = new StringTokenizer(argfiles, ", ", false); | |||
if (tok.hasMoreTokens() && this.argfiles == null) { | |||
this.argfiles = new Vector(); | |||
this.argfiles = new Vector<>(); | |||
} | |||
while (tok.hasMoreTokens()) { | |||
this.argfiles.add(project.resolveFile(tok.nextToken().trim())); |
@@ -63,8 +63,8 @@ public class Ajc11CompilerAdapter implements CompilerAdapter { | |||
public static final String CLEAN = "build.compiler.clean"; | |||
/** track whether we re-called <code>javac.execute()</code> */ | |||
private static final ThreadLocal inSelfCall = new ThreadLocal() { | |||
public Object initialValue() { | |||
private static final ThreadLocal<Boolean> inSelfCall = new ThreadLocal<Boolean>() { | |||
public Boolean initialValue() { | |||
return Boolean.FALSE; | |||
} | |||
}; |
@@ -75,7 +75,7 @@ public class Ajc2 extends Javac { | |||
* The file is a line-delimited list of arguments | |||
* these arguments are inserted into the argument list | |||
*/ | |||
private List argfiles; | |||
private List<Argfile> argfiles; | |||
/* ---------------------------------------------------------------------- | |||
@@ -239,7 +239,7 @@ public class Ajc2 extends Javac { | |||
public Argfile createArgfile() { | |||
Argfile argfile = new Argfile(); | |||
if (argfiles == null) { | |||
argfiles = new ArrayList(); | |||
argfiles = new ArrayList<>(); | |||
} | |||
argfiles.add(argfile); | |||
return argfile; | |||
@@ -408,11 +408,11 @@ public class Ajc2 extends Javac { | |||
* @see org.apache.tools.ant.taskdefs.Javac#scanDir | |||
*/ | |||
protected void scanDir(File srcDir, File destDir, String files[]) { | |||
List newFiles = new ArrayList(); | |||
List<File> newFiles = new ArrayList<>(); | |||
// Add the files listed in the argfiles to the includes | |||
List newIncludes = new ArrayList(); | |||
List newArguments = new ArrayList(); | |||
List<File> newIncludes = new ArrayList<>(); | |||
List<String> newArguments = new ArrayList<>(); | |||
if (argfiles != null) { | |||
for (Object o : argfiles) { | |||
File argfile = ((Argfile) o).getFile(); | |||
@@ -457,7 +457,7 @@ public class Ajc2 extends Javac { | |||
} | |||
} | |||
private void expandArgfile(File argfile, List includes, List arguments) { | |||
private void expandArgfile(File argfile, List<File> includes, List<String> arguments) { | |||
log("argfile:" + argfile, Project.MSG_VERBOSE); | |||
@@ -233,20 +233,20 @@ public class AjcTask extends MatchingTask { | |||
private static final String USAGE_SUBSTRING = "AspectJ-specific options"; | |||
/** valid -X[...] options other than -Xlint variants */ | |||
private static final List VALID_XOPTIONS; | |||
private static final List<String> VALID_XOPTIONS; | |||
/** valid warning (-warn:[...]) variants */ | |||
private static final List VALID_WARNINGS; | |||
private static final List<String> VALID_WARNINGS; | |||
/** valid debugging (-g:[...]) variants */ | |||
private static final List VALID_DEBUG; | |||
private static final List<String> VALID_DEBUG; | |||
/** | |||
* -Xlint variants (error, warning, ignore) | |||
* | |||
* @see org.aspectj.weaver.Lint | |||
*/ | |||
private static final List VALID_XLINT; | |||
private static final List<String> VALID_XLINT; | |||
public static final String COMMAND_EDITOR_NAME = AjcTask.class.getName() + ".COMMAND_EDITOR"; | |||
@@ -286,7 +286,7 @@ public class AjcTask extends MatchingTask { | |||
String editorClassName = System.getProperty(COMMAND_EDITOR_NAME); | |||
if (null != editorClassName) { | |||
ClassLoader cl = AjcTask.class.getClassLoader(); | |||
Class editorClass = cl.loadClass(editorClassName); | |||
Class<?> editorClass = cl.loadClass(editorClassName); | |||
editor = (ICommandEditor) editorClass.getDeclaredConstructor().newInstance(); | |||
} | |||
} catch (Throwable t) { | |||
@@ -318,7 +318,7 @@ public class AjcTask extends MatchingTask { | |||
private Path aspectpath; | |||
private Path argfiles; | |||
private Path inxmlfiles; | |||
private List ignored; | |||
private List<String> ignored; | |||
private Path sourceRoots; | |||
private File xweaveDir; | |||
private String xdoneSignal; | |||
@@ -326,7 +326,7 @@ public class AjcTask extends MatchingTask { | |||
private List<CompilerArg> compilerArgs; | |||
// ----- added by adapter - integrate better? | |||
private List /* File */adapterFiles; | |||
private List<File> adapterFiles; | |||
private String[] adapterArguments; | |||
private IMessageHolder messageHolder; | |||
@@ -388,7 +388,7 @@ public class AjcTask extends MatchingTask { | |||
public void reset() { // XXX possible to reset MatchingTask? | |||
// need declare for "all fields initialized in ..." | |||
adapterArguments = null; | |||
adapterFiles = new ArrayList(); | |||
adapterFiles = new ArrayList<>(); | |||
compilerArgs = null; | |||
argfiles = null; | |||
inxmlfiles = null; | |||
@@ -407,7 +407,7 @@ public class AjcTask extends MatchingTask { | |||
forkclasspath = null; | |||
inIncrementalMode = false; | |||
inIncrementalFileMode = false; | |||
ignored = new ArrayList(); | |||
ignored = new ArrayList<>(); | |||
injars = null; | |||
inpath = null; | |||
listFileArgs = false; | |||
@@ -864,7 +864,7 @@ public class AjcTask extends MatchingTask { | |||
*/ | |||
public void setMessageHolderClass(String className) { | |||
try { | |||
Class mclass = Class.forName(className); | |||
Class<?> mclass = Class.forName(className); | |||
IMessageHolder holder = (IMessageHolder) mclass.getDeclaredConstructor().newInstance(); | |||
setMessageHolder(holder); | |||
} catch (Throwable t) { | |||
@@ -888,7 +888,7 @@ public class AjcTask extends MatchingTask { | |||
*/ | |||
public void setCommandEditorClass(String className) { // skip Ant interface? | |||
try { | |||
Class mclass = Class.forName(className); | |||
Class<?> mclass = Class.forName(className); | |||
setCommandEditor((ICommandEditor) mclass.getDeclaredConstructor().newInstance()); | |||
} catch (Throwable t) { | |||
String m = "unable to instantiate command editor: " + className; | |||
@@ -1178,7 +1178,7 @@ public class AjcTask extends MatchingTask { | |||
outjarFixedup = true; | |||
} | |||
ArrayList result = new ArrayList(cmd.extractArguments()); | |||
ArrayList<String> result = new ArrayList(cmd.extractArguments()); | |||
addListArgs(result); | |||
String[] command = (String[]) result.toArray(new String[0]); | |||
@@ -2032,7 +2032,7 @@ public class AjcTask extends MatchingTask { | |||
// } | |||
List extractArguments() { | |||
List result = new ArrayList(); | |||
List<String> result = new ArrayList<>(); | |||
String[] cmds = command.getArguments(); | |||
if (!LangUtil.isEmpty(cmds)) { | |||
result.addAll(Arrays.asList(cmds)); |
@@ -155,7 +155,7 @@ public class Ajdoc extends MatchingTask { | |||
public void setSourcefiles(String list) { | |||
(sourcefiles == null ? | |||
sourcefiles = new ArrayList() : | |||
sourcefiles = new ArrayList<>() : | |||
sourcefiles).addAll(strings(list)); | |||
} | |||
@@ -81,7 +81,7 @@ public class Ajc extends DefaultCompilerAdapter { | |||
PrintStream err = System.err; | |||
PrintStream out = System.out; | |||
try { | |||
Class main = Class.forName(MAIN_CLASS_NAME); | |||
Class<?> main = Class.forName(MAIN_CLASS_NAME); | |||
if (main == null) { | |||
throw new ClassNotFoundException(MAIN_CLASS_NAME); | |||
} | |||
@@ -122,7 +122,7 @@ public class Ajc extends DefaultCompilerAdapter { | |||
private String[] removeUnsupported(Commandline cline, PrintStream log) { | |||
if (null == log) log = System.err; | |||
String[] args = cline.getCommandline(); | |||
List argsList = new ArrayList(); | |||
List<String> argsList = new ArrayList<>(); | |||
for (int i = 0; i < args.length; i++) { | |||
String arg = args[i]; | |||
if (javacOnlyFlags.contains(arg)) { |