@@ -773,14 +773,13 @@ public class Copy extends Task { | |||
final FileNameMapper mapper, final Hashtable<String, String[]> map) { | |||
String[] toCopy = null; | |||
if (forceOverwrite) { | |||
final Vector<String> v = new Vector<>(); | |||
final List<String> v = new ArrayList<String>(); | |||
for (String name : names) { | |||
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 { | |||
final SourceFileScanner ds = new SourceFileScanner(this); | |||
toCopy = ds.restrict(names, fromDir, toDir, mapper, granularity); | |||
@@ -1908,14 +1908,12 @@ public class Javadoc extends Task { | |||
private void doDoclet(final Commandline toExecute) { | |||
if (doclet != 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.getName()); | |||
if (doclet.getPath() != null) { | |||
final Path docletPath | |||
= doclet.getPath().concatSystemClasspath("ignore"); | |||
final Path docletPath = doclet.getPath().concatSystemClasspath("ignore"); | |||
if (docletPath.size() != 0) { | |||
toExecute.createArgument().setValue("-docletpath"); | |||
toExecute.createArgument().setPath(docletPath); | |||
@@ -1925,7 +1923,6 @@ public class Javadoc extends Task { | |||
if (param.getName() == null) { | |||
throw new BuildException("Doclet parameters must have a name"); | |||
} | |||
toExecute.createArgument().setValue(param.getName()); | |||
if (param.getValue() != null) { | |||
toExecute.createArgument().setValue(param.getValue()); | |||
@@ -2120,20 +2117,15 @@ public class Javadoc extends Task { | |||
ta.getDirectoryScanner(getProject()); | |||
for (String file : tagDefScanner.getIncludedFiles()) { | |||
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) { | |||
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 | |||
* 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(); | |||
if (GZIP.equals(v)) { | |||
return new GZIPInputStream(istream); | |||
@@ -478,12 +478,11 @@ public class Depend extends MatchingTask { | |||
// without closure we may delete an inner class but not the | |||
// top level class which would not trigger a recompile. | |||
int aci = affectedClass.indexOf('$'); | |||
if (aci == -1) { | |||
if (!affectedClass.contains("$")) { | |||
continue; | |||
} | |||
// need to delete the main class | |||
String topLevelClassName = affectedClass.substring(0, aci); | |||
String topLevelClassName = affectedClass.substring(0, affectedClass.indexOf("$")); | |||
log("Top level class = " + topLevelClassName, | |||
Project.MSG_VERBOSE); | |||
ClassFileInfo topLevelClassInfo | |||
@@ -42,7 +42,6 @@ import org.w3c.dom.Document; | |||
import org.w3c.dom.Element; | |||
import org.xml.sax.SAXException; | |||
/** | |||
* Aggregates all <junit> XML formatter testsuite data under | |||
* a specific directory and transforms the results via XSLT. | |||
@@ -476,9 +476,7 @@ public class FTPTaskMirrorImpl implements FTPTaskMirror { | |||
* @param fast boolean | |||
*/ | |||
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 (fast) { | |||
if (file.isSymbolicLink()) { | |||
@@ -724,16 +722,14 @@ public class FTPTaskMirrorImpl implements FTPTaskMirror { | |||
} | |||
this.curpwd = parent.getAbsolutePath(); | |||
} 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) { | |||
try { | |||
if (!this.client.changeWorkingDirectory(currentPathElement)) { | |||
if (!isCaseSensitive() && (remoteSystemCaseSensitive | |||
|| !remoteSensitivityChecked)) { | |||
currentPathElement = | |||
findPathElementCaseUnsensitive(this.curpwd, | |||
|| !remoteSensitivityChecked)) { | |||
currentPathElement = findPathElementCaseUnsensitive(this.curpwd, | |||
currentPathElement); | |||
if (currentPathElement == null) { | |||
return; | |||
@@ -741,12 +737,10 @@ public class FTPTaskMirrorImpl implements FTPTaskMirror { | |||
} | |||
return; | |||
} | |||
this.curpwd = | |||
getCurpwdPlusFileSep() + currentPathElement; | |||
this.curpwd = getCurpwdPlusFileSep() + currentPathElement; | |||
} 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); | |||
@@ -430,8 +430,8 @@ public class Commandline implements Cloneable { | |||
return '\'' + argument + '\''; | |||
} | |||
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; | |||
@@ -593,8 +593,7 @@ public class FilterSet extends DataType implements Cloneable { | |||
} | |||
passedTokens.addElement(parent); | |||
String value = iReplaceTokens(line); | |||
if (!value.contains(beginToken) && !duplicateToken | |||
&& recurseDepth == 1) { | |||
if (!value.contains(beginToken) && !duplicateToken && recurseDepth == 1) { | |||
passedTokens = null; | |||
} else if (duplicateToken) { | |||
// should always be the case... | |||