Browse Source

Merge 1.9.x

master
Gintas Grigelionis 7 years ago
parent
commit
f6f16d98d9
8 changed files with 27 additions and 46 deletions
  1. +3
    -4
      src/main/org/apache/tools/ant/taskdefs/Copy.java
  2. +10
    -18
      src/main/org/apache/tools/ant/taskdefs/Javadoc.java
  3. +2
    -3
      src/main/org/apache/tools/ant/taskdefs/Untar.java
  4. +2
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/depend/Depend.java
  5. +0
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java
  6. +7
    -13
      src/main/org/apache/tools/ant/taskdefs/optional/net/FTPTaskMirrorImpl.java
  7. +2
    -2
      src/main/org/apache/tools/ant/types/Commandline.java
  8. +1
    -2
      src/main/org/apache/tools/ant/types/FilterSet.java

+ 3
- 4
src/main/org/apache/tools/ant/taskdefs/Copy.java View File

@@ -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);


+ 10
- 18
src/main/org/apache/tools/ant/taskdefs/Javadoc.java View File

@@ -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);
}
}
}


+ 2
- 3
src/main/org/apache/tools/ant/taskdefs/Untar.java View File

@@ -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);


+ 2
- 3
src/main/org/apache/tools/ant/taskdefs/optional/depend/Depend.java View File

@@ -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


+ 0
- 1
src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java View File

@@ -42,7 +42,6 @@ import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;


/**
* Aggregates all &lt;junit&gt; XML formatter testsuite data under
* a specific directory and transforms the results via XSLT.


+ 7
- 13
src/main/org/apache/tools/ant/taskdefs/optional/net/FTPTaskMirrorImpl.java View File

@@ -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);


+ 2
- 2
src/main/org/apache/tools/ant/types/Commandline.java View File

@@ -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;


+ 1
- 2
src/main/org/apache/tools/ant/types/FilterSet.java View File

@@ -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...


Loading…
Cancel
Save