Skip to content

Commit

Permalink
Use "out" for output and never return a null stream.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Feb 24, 2015
1 parent e3cf9a9 commit 19e4c3a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/src/main/java/org/jruby/util/ShellLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -866,9 +866,11 @@ public static InputStream unwrapBufferedStream(InputStream filteredStream) {
public static OutputStream unwrapFilterOutputStream(OutputStream filteredStream) {
while (filteredStream instanceof FilterOutputStream) {
try {
filteredStream = (OutputStream)
OutputStream tmpStream = (OutputStream)
FieldAccess.getProtectedFieldValue(FilterOutputStream.class,
"in", filteredStream);
"out", filteredStream);
if (tmpStream == null) break;
filteredStream = tmpStream;
} catch (Exception e) {
break; // break out if we've dug as deep as we can
}
Expand All @@ -891,9 +893,11 @@ public static OutputStream unwrapFilterOutputStream(OutputStream filteredStream)
public static InputStream unwrapFilterInputStream(InputStream filteredStream) {
while (filteredStream instanceof FilterInputStream) {
try {
filteredStream = (InputStream)
InputStream tmpStream = (InputStream)
FieldAccess.getProtectedFieldValue(FilterInputStream.class,
"in", filteredStream);
if (tmpStream == null) break;
filteredStream = tmpStream;
} catch (Exception e) {
break; // break out if we've dug as deep as we can
}
Expand Down

0 comments on commit 19e4c3a

Please sign in to comment.