Browse Source

The small things you find when reviewing code

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276387 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 21 years ago
parent
commit
819d9a02f1
6 changed files with 17 additions and 12 deletions
  1. +1
    -1
      docs/manual/CoreTypes/redirector.html
  2. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/ExecTask.java
  3. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/Java.java
  4. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/Redirector.java
  5. +8
    -4
      src/main/org/apache/tools/ant/types/RedirectorElement.java
  6. +1
    -1
      src/main/org/apache/tools/ant/util/ReaderInputStream.java

+ 1
- 1
docs/manual/CoreTypes/redirector.html View File

@@ -139,7 +139,7 @@ Tasks known to support I/O redirection:
</ul> </ul>
<p>The expected behavior of a &lt;redirector&gt; is to a great degree <p>The expected behavior of a &lt;redirector&gt; is to a great degree
dependent on the supporting task. Any possible points of confusion dependent on the supporting task. Any possible points of confusion
should be noted at the task level.
should be noted at the task level.</p>
<hr /> <hr />
<p align="center">Copyright &copy; 2004 The Apache Software Foundation. All rights <p align="center">Copyright &copy; 2004 The Apache Software Foundation. All rights
Reserved.</p> Reserved.</p>


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

@@ -190,7 +190,7 @@ public class ExecTask extends Task {
*/ */
public void setLogError(boolean logError) { public void setLogError(boolean logError) {
redirector.setLogError(logError); redirector.setLogError(logError);
incompatibleWithSpawn = true;
incompatibleWithSpawn |= logError;
} }


/** /**
@@ -236,7 +236,7 @@ public class ExecTask extends Task {
*/ */
public void setFailonerror(boolean fail) { public void setFailonerror(boolean fail) {
failOnError = fail; failOnError = fail;
incompatibleWithSpawn = true;
incompatibleWithSpawn |= fail;
} }


/** /**
@@ -308,8 +308,8 @@ public class ExecTask extends Task {
* @param result value desired for the result property value * @param result value desired for the result property value
*/ */
protected void maybeSetResultPropertyValue(int result) { protected void maybeSetResultPropertyValue(int result) {
String res = Integer.toString(result);
if (resultProperty != null) { if (resultProperty != null) {
String res = Integer.toString(result);
getProject().setNewProperty(resultProperty, res); getProject().setNewProperty(resultProperty, res);
} }
} }


+ 2
- 1
src/main/org/apache/tools/ant/taskdefs/Java.java View File

@@ -332,6 +332,7 @@ public class Java extends Task {
*/ */
public void setResultProperty(String resultProperty) { public void setResultProperty(String resultProperty) {
this.resultProperty = resultProperty; this.resultProperty = resultProperty;
incompatibleWithSpawn = true;
} }


/** /**
@@ -474,7 +475,7 @@ public class Java extends Task {
*/ */
public void setLogError(boolean logError) { public void setLogError(boolean logError) {
redirector.setLogError(logError); redirector.setLogError(logError);
incompatibleWithSpawn = true;
incompatibleWithSpawn |= logError;
} }


/** /**


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

@@ -78,7 +78,7 @@ public class Redirector {


/** /**
* The file(s) from which standard input is being taken. * The file(s) from which standard input is being taken.
* If > 1, files' content will be concatenated in the order received.
* If &gt; 1, files' content will be concatenated in the order received.
*/ */
private File[] input; private File[] input;


@@ -137,7 +137,7 @@ public class Redirector {
/** The stream for input */ /** The stream for input */
private InputStream inputStream = null; private InputStream inputStream = null;


/** Stream which are used for line oriented output */
/** Stream which is used for line oriented output */
private PrintStream outPrintStream = null; private PrintStream outPrintStream = null;


/** Stream which is used for line oriented error output */ /** Stream which is used for line oriented error output */


+ 8
- 4
src/main/org/apache/tools/ant/types/RedirectorElement.java View File

@@ -47,10 +47,10 @@ public class RedirectorElement extends DataType {
private boolean usingError = false; private boolean usingError = false;


/** /**
* Indicates if standard error should be logged to Ant's log system
* rather than the output. This has no effect if standard error is
* redirected to a file or property.
*/
* Indicates if standard error should be logged to Ant's log system
* rather than the output. This has no effect if standard error is
* redirected to a file or property.
*/
private Boolean logError; private Boolean logError;


/** The name of the property into which output is to be stored */ /** The name of the property into which output is to be stored */
@@ -165,6 +165,10 @@ public class RedirectorElement extends DataType {
|| inputString != null || inputString != null
|| logError != null || logError != null
|| append != null || append != null
|| createEmptyFiles != null
|| inputEncoding != null
|| outputEncoding != null
|| errorEncoding != null
|| outputProperty != null || outputProperty != null
|| errorProperty != null) { || errorProperty != null) {
throw tooManyAttributes(); throw tooManyAttributes();


+ 1
- 1
src/main/org/apache/tools/ant/util/ReaderInputStream.java View File

@@ -130,7 +130,7 @@ public class ReaderInputStream extends InputStream {


System.arraycopy(slack, begin, b, off, len); System.arraycopy(slack, begin, b, off, len);


if ((begin+= len) >= slack.length) {
if ((begin += len) >= slack.length) {
slack = null; slack = null;
} }




Loading…
Cancel
Save