hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1484890 - /httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicNameValuePair.java
Date Tue, 21 May 2013 17:51:49 GMT
Author: ggregory
Date: Tue May 21 17:51:48 2013
New Revision: 1484890

URL: http://svn.apache.org/r1484890
Log:
Simplify control flow: Statements unnecessarily nested within else clause. 

Modified:
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicNameValuePair.java

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicNameValuePair.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicNameValuePair.java?rev=1484890&r1=1484889&r2=1484890&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicNameValuePair.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicNameValuePair.java
Tue May 21 17:51:48 2013
@@ -73,14 +73,13 @@ public class BasicNameValuePair implemen
 
         if (this.value == null) {
             return name;
-        } else {
-            final int len = this.name.length() + 1 + this.value.length();
-            final StringBuilder buffer = new StringBuilder(len);
-            buffer.append(this.name);
-            buffer.append("=");
-            buffer.append(this.value);
-            return buffer.toString();
         }
+        final int len = this.name.length() + 1 + this.value.length();
+        final StringBuilder buffer = new StringBuilder(len);
+        buffer.append(this.name);
+        buffer.append("=");
+        buffer.append(this.value);
+        return buffer.toString();
     }
 
     @Override
@@ -92,9 +91,8 @@ public class BasicNameValuePair implemen
             final BasicNameValuePair that = (BasicNameValuePair) object;
             return this.name.equals(that.name)
                   && LangUtils.equals(this.value, that.value);
-        } else {
-            return false;
         }
+        return false;
     }
 
     @Override



Mime
View raw message