From ab89b8b40ee593e344dafb6192fd6ef3b1357c8b Mon Sep 17 00:00:00 2001 From: wineandcheeze Date: Thu, 10 Oct 2019 13:50:50 +0200 Subject: [PATCH] THRIFT-2530: Fix TIOStreamTransport#isOpen isOpen should return false when close is called. Client: java This closes #1878. --- CHANGES.md | 1 + .../src/org/apache/thrift/transport/TIOStreamTransport.java | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 9d13d9501c..35e8ccba08 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -26,6 +26,7 @@ - [THRIFT-4712](https://issues.apache.org/jira/browse/THRIFT-4712) - java: class org.apache.thrift.ShortStack is no longer public - [THRIFT-4725](https://issues.apache.org/jira/browse/THRIFT-4725) - java: change return type signature of 'process' methods - [THRIFT-4805](https://issues.apache.org/jira/browse/THRIFT-4805) - java: replaced TSaslTransportException with TTransportException +- [THRIFT-2530](https://issues.apache.org/jira/browse/THRIFT-2530) - java: TIOStreamTransport's "isOpen" now returns false after "close" is called - [THRIFT-4675](https://issues.apache.org/jira/browse/THRIFT-4675) - js: now uses node-int64 for 64 bit integer constants - [THRIFT-4841](https://issues.apache.org/jira/browse/THRIFT-4841) - delphi: old THTTPTransport is now TMsxmlHTTPTransport - [THRIFT-4536](https://issues.apache.org/jira/browse/THRIFT-4536) - rust: convert from try-from crate to rust stable (1.34+), re-export ordered-float diff --git a/lib/java/src/org/apache/thrift/transport/TIOStreamTransport.java b/lib/java/src/org/apache/thrift/transport/TIOStreamTransport.java index 93b051f319..2d31f392f4 100644 --- a/lib/java/src/org/apache/thrift/transport/TIOStreamTransport.java +++ b/lib/java/src/org/apache/thrift/transport/TIOStreamTransport.java @@ -79,13 +79,11 @@ public TIOStreamTransport(InputStream is, OutputStream os) { } /** - * The streams must already be open at construction time, so this should - * always return true. * - * @return true + * @return false after close is called. */ public boolean isOpen() { - return true; + return inputStream_ != null && outputStream_ != null; } /**