hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1753867 - /httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
Date Sat, 23 Jul 2016 11:03:12 GMT
Author: olegk
Date: Sat Jul 23 11:03:12 2016
New Revision: 1753867

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

Modified:
    httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java

Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java?rev=1753867&r1=1753866&r2=1753867&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
Sat Jul 23 11:03:12 2016
@@ -307,8 +307,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();
@@ -324,13 +324,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;
@@ -559,7 +557,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
@@ -570,7 +568,6 @@ public class SSLIOSession implements IOS
             // Release outPlain if empty
             if (outPlainBuf.position() == 0) {
                 this.outPlain.release();
-                outPlainBuf = null;
             }
         }
         if (!this.outPlain.hasData()) {
@@ -588,7 +585,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();
@@ -601,7 +598,6 @@ public class SSLIOSession implements IOS
             // Release if empty
             if (inPlainBuf.position() == 0) {
                 this.inPlain.release();
-                inPlainBuf = null;
             }
             return n;
         }



Mime
View raw message