Browse Source

Merge branch '1.9.x'

master
Stefan Bodewig 7 years ago
parent
commit
36a2087a6c
2 changed files with 21 additions and 10 deletions
  1. +7
    -0
      WHATSNEW
  2. +14
    -10
      src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java

+ 7
- 0
WHATSNEW View File

@@ -19,6 +19,13 @@ Other changes:
* AntAssert is deprecated, assertThat from JUnit 4.4+, Hamcrest matchers and/or * AntAssert is deprecated, assertThat from JUnit 4.4+, Hamcrest matchers and/or
ExpectedException rule provide equivalent functionality ExpectedException rule provide equivalent functionality


* PumpStreamHandler now explicitly verifies the streams for output
and error are not null and will throw an exception if they
are. This way creating a PumpStreamHandler will fail early as
opposed to some obscure errors later when closing streams or
finishing threads might fail.
Bugzilla Report 62148

Changes from Ant 1.10.2 TO Ant 1.10.3 Changes from Ant 1.10.2 TO Ant 1.10.3
===================================== =====================================




+ 14
- 10
src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java View File

@@ -44,14 +44,20 @@ public class PumpStreamHandler implements ExecuteStreamHandler {


/** /**
* Construct a new <code>PumpStreamHandler</code>. * Construct a new <code>PumpStreamHandler</code>.
* @param out the output <code>OutputStream</code>.
* @param err the error <code>OutputStream</code>.
* @param out the output <code>OutputStream</code>, must not be null.
* @param err the error <code>OutputStream</code>, must not be null.
* @param input the input <code>InputStream</code>. * @param input the input <code>InputStream</code>.
* @param nonBlockingRead set it to <code>true</code> if the input should be * @param nonBlockingRead set it to <code>true</code> if the input should be
* read with simulated non blocking IO. * read with simulated non blocking IO.
*/ */
public PumpStreamHandler(OutputStream out, OutputStream err, public PumpStreamHandler(OutputStream out, OutputStream err,
InputStream input, boolean nonBlockingRead) { InputStream input, boolean nonBlockingRead) {
if (out == null) {
throw new NullPointerException("out must not be null");
}
if (err == null) {
throw new NullPointerException("err must not be null");
}
this.out = out; this.out = out;
this.err = err; this.err = err;
this.input = input; this.input = input;
@@ -60,8 +66,8 @@ public class PumpStreamHandler implements ExecuteStreamHandler {


/** /**
* Construct a new <code>PumpStreamHandler</code>. * Construct a new <code>PumpStreamHandler</code>.
* @param out the output <code>OutputStream</code>.
* @param err the error <code>OutputStream</code>.
* @param out the output <code>OutputStream</code>, must not be null.
* @param err the error <code>OutputStream</code>, must not be null.
* @param input the input <code>InputStream</code>. * @param input the input <code>InputStream</code>.
*/ */
public PumpStreamHandler(OutputStream out, OutputStream err, public PumpStreamHandler(OutputStream out, OutputStream err,
@@ -71,8 +77,8 @@ public class PumpStreamHandler implements ExecuteStreamHandler {


/** /**
* Construct a new <code>PumpStreamHandler</code>. * Construct a new <code>PumpStreamHandler</code>.
* @param out the output <code>OutputStream</code>.
* @param err the error <code>OutputStream</code>.
* @param out the output <code>OutputStream</code>, must not be null.
* @param err the error <code>OutputStream</code>, must not be null.
*/ */
public PumpStreamHandler(OutputStream out, OutputStream err) { public PumpStreamHandler(OutputStream out, OutputStream err) {
this(out, err, null); this(out, err, null);
@@ -80,7 +86,7 @@ public class PumpStreamHandler implements ExecuteStreamHandler {


/** /**
* Construct a new <code>PumpStreamHandler</code>. * Construct a new <code>PumpStreamHandler</code>.
* @param outAndErr the output/error <code>OutputStream</code>.
* @param outAndErr the output/error <code>OutputStream</code>, must not be null.
*/ */
public PumpStreamHandler(OutputStream outAndErr) { public PumpStreamHandler(OutputStream outAndErr) {
this(outAndErr, outAndErr); this(outAndErr, outAndErr);
@@ -108,9 +114,7 @@ public class PumpStreamHandler implements ExecuteStreamHandler {
* @param is the <code>InputStream</code>. * @param is the <code>InputStream</code>.
*/ */
public void setProcessErrorStream(InputStream is) { public void setProcessErrorStream(InputStream is) {
if (err != null) {
createProcessErrorPump(is, err);
}
createProcessErrorPump(is, err);
} }


/** /**


Loading…
Cancel
Save