hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1734440 - in /httpcomponents/httpcore/trunk: httpcore5-h2/src/main/java/org/apache/hc/core5/http2/hpack/ httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/io/ httpcore5/src/main/java/org/apache/hc/core5/http/ httpcore5/src/main/jav...
Date Thu, 10 Mar 2016 18:31:08 GMT
Author: ggregory
Date: Thu Mar 10 18:31:07 2016
New Revision: 1734440

URL: http://svn.apache.org/viewvc?rev=1734440&view=rev
Log:
https://github.com/apache/httpcore/pull/23 - Code quality fix - Useless parentheses around
expressions should be removed to prevent any misunderstanding.

Modified:
    httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/hpack/HuffmanEncoder.java
    httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/io/SessionInputBufferImpl.java
    httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/ProtocolVersion.java
    httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicHeaderIterator.java
    httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicListHeaderIterator.java
    httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java
    httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/NetUtils.java

Modified: httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/hpack/HuffmanEncoder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/hpack/HuffmanEncoder.java?rev=1734440&r1=1734439&r2=1734440&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/hpack/HuffmanEncoder.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/hpack/HuffmanEncoder.java
Thu Mar 10 18:31:07 2016
@@ -61,7 +61,7 @@ final class HuffmanEncoder {
 
             while (n >= 8) {
                 n -= 8;
-                out.append(((int)(current >> n)));
+                out.append((int)(current >> n));
             }
         }
 
@@ -88,7 +88,7 @@ final class HuffmanEncoder {
 
             while (n >= 8) {
                 n -= 8;
-                out.append(((int)(current >> n)));
+                out.append((int)(current >> n));
             }
         }
 

Modified: httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/io/SessionInputBufferImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/io/SessionInputBufferImpl.java?rev=1734440&r1=1734439&r2=1734440&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/io/SessionInputBufferImpl.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/io/SessionInputBufferImpl.java
Thu Mar 10 18:31:07 2016
@@ -116,7 +116,7 @@ public class SessionInputBufferImpl impl
         } else {
             fillBuffer(instream, FrameConsts.HEAD_LEN + 1);
             payloadOff = FrameConsts.HEAD_LEN + 1;
-            padding = (buffer[off + 9] & 0xff);
+            padding = buffer[off + 9] & 0xff;
         }
 
         final int frameLen = payloadOff + payloadLen + padding;

Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/ProtocolVersion.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/ProtocolVersion.java?rev=1734440&r1=1734439&r2=1734440&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/ProtocolVersion.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/ProtocolVersion.java
Thu Mar 10 18:31:07 2016
@@ -161,9 +161,9 @@ public class ProtocolVersion implements
         }
         final ProtocolVersion that = (ProtocolVersion) obj;
 
-        return ((this.protocol.equals(that.protocol)) &&
-                (this.major == that.major) &&
-                (this.minor == that.minor));
+        return (this.protocol.equals(that.protocol) &&
+               (this.major == that.major) &&
+               (this.minor == that.minor));
     }
 
 

Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicHeaderIterator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicHeaderIterator.java?rev=1734440&r1=1734439&r2=1734440&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicHeaderIterator.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicHeaderIterator.java
Thu Mar 10 18:31:07 2016
@@ -115,7 +115,7 @@ public class BasicHeaderIterator impleme
 
     @Override
     public boolean hasNext() {
-        return (this.currentIndex >= 0);
+        return this.currentIndex >= 0;
     }
 
     /**

Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicListHeaderIterator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicListHeaderIterator.java?rev=1734440&r1=1734439&r2=1734440&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicListHeaderIterator.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicListHeaderIterator.java
Thu Mar 10 18:31:07 2016
@@ -128,7 +128,7 @@ class BasicListHeaderIterator implements
 
     @Override
     public boolean hasNext() {
-        return (this.currentIndex >= 0);
+        return this.currentIndex >= 0;
     }
 
     /**

Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java?rev=1734440&r1=1734439&r2=1734440&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java
Thu Mar 10 18:31:07 2016
@@ -322,7 +322,7 @@ public class IOSessionImpl implements IO
 
     private static void formatAddress(final StringBuilder buffer, final SocketAddress socketAddress)
{
         if (socketAddress instanceof InetSocketAddress) {
-            final InetSocketAddress addr = ((InetSocketAddress) socketAddress);
+            final InetSocketAddress addr = (InetSocketAddress) socketAddress;
             buffer.append(addr.getAddress() != null ? addr.getAddress().getHostAddress()
:
                 addr.getAddress())
             .append(':')

Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/NetUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/NetUtils.java?rev=1734440&r1=1734439&r2=1734440&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/NetUtils.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/util/NetUtils.java
Thu Mar 10 18:31:07 2016
@@ -42,7 +42,7 @@ public final class NetUtils {
         Args.notNull(buffer, "Buffer");
         Args.notNull(socketAddress, "Socket address");
         if (socketAddress instanceof InetSocketAddress) {
-            final InetSocketAddress socketaddr = ((InetSocketAddress) socketAddress);
+            final InetSocketAddress socketaddr = (InetSocketAddress) socketAddress;
             final InetAddress inetaddr = socketaddr.getAddress();
             buffer.append(inetaddr != null ? inetaddr.getHostAddress() : inetaddr)
                 .append(':').append(socketaddr.getPort());



Mime
View raw message