commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1782091 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/org/apache/commons/net/telnet/TelnetClient.java
Date Tue, 07 Feb 2017 23:52:49 GMT
Author: sebb
Date: Tue Feb  7 23:52:49 2017
New Revision: 1782091

URL: http://svn.apache.org/viewvc?rev=1782091&view=rev
Log:
NET-596 NullPointerException when disconnecting TelnetClient twice with JDK 7

Modified:
    commons/proper/net/trunk/src/changes/changes.xml
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetClient.java

Modified: commons/proper/net/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1782091&r1=1782090&r2=1782091&view=diff
==============================================================================
--- commons/proper/net/trunk/src/changes/changes.xml [utf-8] (original)
+++ commons/proper/net/trunk/src/changes/changes.xml [utf-8] Tue Feb  7 23:52:49 2017
@@ -87,6 +87,9 @@ without checking it if is a space.
   The POP3Mail examples can now get password from console, stdin or an environment variable.
   
 ">
+            <action issue="NET-596" type="fix" dev="sebb" due-to="Vincent Bories-Azeau">
+            NullPointerException when disconnecting TelnetClient twice with JDK 7
+            </action>
             <action issue="NET-602" type="fix" dev="sebb" due-to="Ross Braithwaite">
             Failure to parse times from SYST_L8 systems that report as "WINDOWS Type: L8"
             </action>

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetClient.java?rev=1782091&r1=1782090&r2=1782091&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetClient.java
(original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetClient.java
Tue Feb  7 23:52:49 2017
@@ -80,7 +80,11 @@ public class TelnetClient extends Telnet
     }
     void _closeOutputStream() throws IOException
     {
-        _output_.close();
+        try {
+            _output_.close();            
+        } finally {
+            _output_ = null;
+        }
     }
 
     /***
@@ -125,6 +129,8 @@ public class TelnetClient extends Telnet
                 __output.close();
             }
         } finally { // NET-594
+            __output = null;
+            __input = null;
             super.disconnect();
         }
     }



Mime
View raw message