@@ -773,14 +773,13 @@ public class Copy extends Task { | |||||
final FileNameMapper mapper, final Hashtable<String, String[]> map) { | final FileNameMapper mapper, final Hashtable<String, String[]> map) { | ||||
String[] toCopy = null; | String[] toCopy = null; | ||||
if (forceOverwrite) { | if (forceOverwrite) { | ||||
final Vector<String> v = new Vector<>(); | |||||
final List<String> v = new ArrayList<String>(); | |||||
for (String name : names) { | for (String name : names) { | ||||
if (mapper.mapFileName(name) != null) { | if (mapper.mapFileName(name) != null) { | ||||
v.addElement(name); | |||||
v.add(name); | |||||
} | } | ||||
} | } | ||||
toCopy = new String[v.size()]; | |||||
v.copyInto(toCopy); | |||||
toCopy = v.toArray(new String[v.size()]); | |||||
} else { | } else { | ||||
final SourceFileScanner ds = new SourceFileScanner(this); | final SourceFileScanner ds = new SourceFileScanner(this); | ||||
toCopy = ds.restrict(names, fromDir, toDir, mapper, granularity); | toCopy = ds.restrict(names, fromDir, toDir, mapper, granularity); | ||||
@@ -1908,14 +1908,12 @@ public class Javadoc extends Task { | |||||
private void doDoclet(final Commandline toExecute) { | private void doDoclet(final Commandline toExecute) { | ||||
if (doclet != null) { | if (doclet != null) { | ||||
if (doclet.getName() == null) { | if (doclet.getName() == null) { | ||||
throw new BuildException("The doclet name must be specified.", | |||||
getLocation()); | |||||
throw new BuildException("The doclet name must be specified.", getLocation()); | |||||
} | } | ||||
toExecute.createArgument().setValue("-doclet"); | toExecute.createArgument().setValue("-doclet"); | ||||
toExecute.createArgument().setValue(doclet.getName()); | toExecute.createArgument().setValue(doclet.getName()); | ||||
if (doclet.getPath() != null) { | if (doclet.getPath() != null) { | ||||
final Path docletPath | |||||
= doclet.getPath().concatSystemClasspath("ignore"); | |||||
final Path docletPath = doclet.getPath().concatSystemClasspath("ignore"); | |||||
if (docletPath.size() != 0) { | if (docletPath.size() != 0) { | ||||
toExecute.createArgument().setValue("-docletpath"); | toExecute.createArgument().setValue("-docletpath"); | ||||
toExecute.createArgument().setPath(docletPath); | toExecute.createArgument().setPath(docletPath); | ||||
@@ -1925,7 +1923,6 @@ public class Javadoc extends Task { | |||||
if (param.getName() == null) { | if (param.getName() == null) { | ||||
throw new BuildException("Doclet parameters must have a name"); | throw new BuildException("Doclet parameters must have a name"); | ||||
} | } | ||||
toExecute.createArgument().setValue(param.getName()); | toExecute.createArgument().setValue(param.getName()); | ||||
if (param.getValue() != null) { | if (param.getValue() != null) { | ||||
toExecute.createArgument().setValue(param.getValue()); | toExecute.createArgument().setValue(param.getValue()); | ||||
@@ -2120,20 +2117,15 @@ public class Javadoc extends Task { | |||||
ta.getDirectoryScanner(getProject()); | ta.getDirectoryScanner(getProject()); | ||||
for (String file : tagDefScanner.getIncludedFiles()) { | for (String file : tagDefScanner.getIncludedFiles()) { | ||||
final File tagDefFile = new File(tagDir, file); | final File tagDefFile = new File(tagDir, file); | ||||
try (final BufferedReader in = | |||||
new BufferedReader(new FileReader(tagDefFile))) { | |||||
String line; | |||||
while ((line = in.readLine()) != null) { | |||||
toExecute.createArgument() | |||||
.setValue("-tag"); | |||||
toExecute.createArgument() | |||||
.setValue(line); | |||||
} | |||||
try (final BufferedReader in = new BufferedReader( | |||||
new FileReader(tagDefFile))) { | |||||
in.lines().forEach(line -> { | |||||
toExecute.createArgument().setValue("-tag"); | |||||
toExecute.createArgument().setValue(line); | |||||
}); | |||||
} catch (final IOException ioe) { | } catch (final IOException ioe) { | ||||
throw new BuildException( | |||||
"Couldn't read tag file from " | |||||
+ tagDefFile.getAbsolutePath(), | |||||
ioe); | |||||
throw new BuildException("Couldn't read tag file from " | |||||
+ tagDefFile.getAbsolutePath(), ioe); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -218,9 +218,8 @@ public class Untar extends Expand { | |||||
* @exception BuildException thrown if bzip stream does not | * @exception BuildException thrown if bzip stream does not | ||||
* start with expected magic values | * start with expected magic values | ||||
*/ | */ | ||||
public InputStream decompress(final String name, | |||||
final InputStream istream) | |||||
throws IOException, BuildException { | |||||
public InputStream decompress(final String name, final InputStream istream) | |||||
throws IOException, BuildException { | |||||
final String v = getValue(); | final String v = getValue(); | ||||
if (GZIP.equals(v)) { | if (GZIP.equals(v)) { | ||||
return new GZIPInputStream(istream); | return new GZIPInputStream(istream); | ||||
@@ -478,12 +478,11 @@ public class Depend extends MatchingTask { | |||||
// without closure we may delete an inner class but not the | // without closure we may delete an inner class but not the | ||||
// top level class which would not trigger a recompile. | // top level class which would not trigger a recompile. | ||||
int aci = affectedClass.indexOf('$'); | |||||
if (aci == -1) { | |||||
if (!affectedClass.contains("$")) { | |||||
continue; | continue; | ||||
} | } | ||||
// need to delete the main class | // need to delete the main class | ||||
String topLevelClassName = affectedClass.substring(0, aci); | |||||
String topLevelClassName = affectedClass.substring(0, affectedClass.indexOf("$")); | |||||
log("Top level class = " + topLevelClassName, | log("Top level class = " + topLevelClassName, | ||||
Project.MSG_VERBOSE); | Project.MSG_VERBOSE); | ||||
ClassFileInfo topLevelClassInfo | ClassFileInfo topLevelClassInfo | ||||
@@ -42,7 +42,6 @@ import org.w3c.dom.Document; | |||||
import org.w3c.dom.Element; | import org.w3c.dom.Element; | ||||
import org.xml.sax.SAXException; | import org.xml.sax.SAXException; | ||||
/** | /** | ||||
* Aggregates all <junit> XML formatter testsuite data under | * Aggregates all <junit> XML formatter testsuite data under | ||||
* a specific directory and transforms the results via XSLT. | * a specific directory and transforms the results via XSLT. | ||||
@@ -476,9 +476,7 @@ public class FTPTaskMirrorImpl implements FTPTaskMirror { | |||||
* @param fast boolean | * @param fast boolean | ||||
*/ | */ | ||||
private void accountForIncludedDir(String name, AntFTPFile file, boolean fast) { | private void accountForIncludedDir(String name, AntFTPFile file, boolean fast) { | ||||
if (!dirsIncluded.contains(name) | |||||
&& !dirsExcluded.contains(name)) { | |||||
if (!dirsIncluded.contains(name) && !dirsExcluded.contains(name)) { | |||||
if (!isExcluded(name)) { | if (!isExcluded(name)) { | ||||
if (fast) { | if (fast) { | ||||
if (file.isSymbolicLink()) { | if (file.isSymbolicLink()) { | ||||
@@ -724,16 +722,14 @@ public class FTPTaskMirrorImpl implements FTPTaskMirror { | |||||
} | } | ||||
this.curpwd = parent.getAbsolutePath(); | this.curpwd = parent.getAbsolutePath(); | ||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
throw new BuildException( | |||||
"could not change working dir to %s", parent.curpwd); | |||||
throw new BuildException("could not change working dir to %s", parent.curpwd); | |||||
} | } | ||||
for (String currentPathElement : pathElements) { | for (String currentPathElement : pathElements) { | ||||
try { | try { | ||||
if (!this.client.changeWorkingDirectory(currentPathElement)) { | if (!this.client.changeWorkingDirectory(currentPathElement)) { | ||||
if (!isCaseSensitive() && (remoteSystemCaseSensitive | if (!isCaseSensitive() && (remoteSystemCaseSensitive | ||||
|| !remoteSensitivityChecked)) { | |||||
currentPathElement = | |||||
findPathElementCaseUnsensitive(this.curpwd, | |||||
|| !remoteSensitivityChecked)) { | |||||
currentPathElement = findPathElementCaseUnsensitive(this.curpwd, | |||||
currentPathElement); | currentPathElement); | ||||
if (currentPathElement == null) { | if (currentPathElement == null) { | ||||
return; | return; | ||||
@@ -741,12 +737,10 @@ public class FTPTaskMirrorImpl implements FTPTaskMirror { | |||||
} | } | ||||
return; | return; | ||||
} | } | ||||
this.curpwd = | |||||
getCurpwdPlusFileSep() + currentPathElement; | |||||
this.curpwd = getCurpwdPlusFileSep() + currentPathElement; | |||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
throw new BuildException( | |||||
"could not change working dir to %s from %s", | |||||
currentPathElement, this.curpwd); | |||||
throw new BuildException("could not change working dir to %s from %s", | |||||
currentPathElement, this.curpwd); | |||||
} | } | ||||
} | } | ||||
String lastpathelement = pathElements.get(pathElements.size() - 1); | String lastpathelement = pathElements.get(pathElements.size() - 1); | ||||
@@ -430,8 +430,8 @@ public class Commandline implements Cloneable { | |||||
return '\'' + argument + '\''; | return '\'' + argument + '\''; | ||||
} | } | ||||
if (argument.contains("\'") || argument.contains(" ") | if (argument.contains("\'") || argument.contains(" ") | ||||
// WIN9x uses a bat file for executing commands | |||||
|| (IS_WIN_9X && argument.contains(";"))) { | |||||
// WIN9x uses a bat file for executing commands | |||||
|| (IS_WIN_9X && argument.contains(";"))) { | |||||
return '\"' + argument + '\"'; | return '\"' + argument + '\"'; | ||||
} | } | ||||
return argument; | return argument; | ||||
@@ -593,8 +593,7 @@ public class FilterSet extends DataType implements Cloneable { | |||||
} | } | ||||
passedTokens.addElement(parent); | passedTokens.addElement(parent); | ||||
String value = iReplaceTokens(line); | String value = iReplaceTokens(line); | ||||
if (!value.contains(beginToken) && !duplicateToken | |||||
&& recurseDepth == 1) { | |||||
if (!value.contains(beginToken) && !duplicateToken && recurseDepth == 1) { | |||||
passedTokens = null; | passedTokens = null; | ||||
} else if (duplicateToken) { | } else if (duplicateToken) { | ||||
// should always be the case... | // should always be the case... | ||||