You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2016/07/23 10:56:49 UTC

svn commit: r1753865 - /httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java

Author: olegk
Date: Sat Jul 23 10:56:49 2016
New Revision: 1753865

URL: http://svn.apache.org/viewvc?rev=1753865&view=rev
Log:
Removed unnecessary null assignments

Modified:
    httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java

Modified: httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java?rev=1753865&r1=1753864&r2=1753865&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java (original)
+++ httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java Sat Jul 23 10:56:49 2016
@@ -320,8 +320,8 @@ public class SSLIOSession implements IOS
                 // Process incoming handshake data
 
                 // Acquire buffers
-                ByteBuffer inEncryptedBuf = this.inEncrypted.acquire();
-                ByteBuffer inPlainBuf = this.inPlain.acquire();
+                final ByteBuffer inEncryptedBuf = this.inEncrypted.acquire();
+                final ByteBuffer inPlainBuf = this.inPlain.acquire();
 
                 // Perform operations
                 inEncryptedBuf.flip();
@@ -337,13 +337,11 @@ public class SSLIOSession implements IOS
                     // Release inEncrypted if empty
                     if (inEncryptedBuf.position() == 0) {
                         this.inEncrypted.release();
-                        inEncryptedBuf = null;
                     }
                 }
 
                 if (this.status >= IOSession.CLOSING) {
                     this.inPlain.release();
-                    inPlainBuf = null;
                 }
                 if (result.getStatus() != Status.OK) {
                     handshaking = false;
@@ -572,7 +570,7 @@ public class SSLIOSession implements IOS
         }
         if (this.outPlain.hasData()) {
             // Acquire buffers
-            ByteBuffer outPlainBuf = this.outPlain.acquire();
+            final ByteBuffer outPlainBuf = this.outPlain.acquire();
             final ByteBuffer outEncryptedBuf = this.outEncrypted.acquire();
 
             // Perform operations
@@ -583,7 +581,6 @@ public class SSLIOSession implements IOS
             // Release outPlain if empty
             if (outPlainBuf.position() == 0) {
                 this.outPlain.release();
-                outPlainBuf = null;
             }
         }
         if (!this.outPlain.hasData()) {
@@ -602,7 +599,7 @@ public class SSLIOSession implements IOS
         Args.notNull(dst, "Byte buffer");
         if (this.inPlain.hasData()) {
             // Acquire buffer
-            ByteBuffer inPlainBuf = this.inPlain.acquire();
+            final ByteBuffer inPlainBuf = this.inPlain.acquire();
 
             // Perform opertaions
             inPlainBuf.flip();
@@ -615,7 +612,6 @@ public class SSLIOSession implements IOS
             // Release if empty
             if (inPlainBuf.position() == 0) {
                 this.inPlain.release();
-                inPlainBuf = null;
             }
             return n;
         } else {