hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1698031 - in /httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime: Header.java content/AbstractContentBody.java
Date Wed, 26 Aug 2015 22:29:06 GMT
Author: ggregory
Date: Wed Aug 26 22:29:05 2015
New Revision: 1698031

URL: http://svn.apache.org/r1698031
Log:
Statement unnecessarily nested within else clause.

Modified:
    httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/Header.java
    httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/AbstractContentBody.java

Modified: httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/Header.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/Header.java?rev=1698031&r1=1698030&r2=1698031&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/Header.java
(original)
+++ httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/Header.java
Wed Aug 26 22:29:05 2015
@@ -88,9 +88,8 @@ public class Header implements Iterable<
         final List<MinimalField> list = this.fieldMap.get(key);
         if (list == null || list.isEmpty()) {
             return Collections.emptyList();
-        } else {
-            return new ArrayList<>(list);
         }
+        return new ArrayList<>(list);
     }
 
     public int removeFields(final String name) {

Modified: httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/AbstractContentBody.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/AbstractContentBody.java?rev=1698031&r1=1698030&r2=1698031&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/AbstractContentBody.java
(original)
+++ httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/AbstractContentBody.java
Wed Aug 26 22:29:05 2015
@@ -67,9 +67,8 @@ public abstract class AbstractContentBod
         final int i = mimeType.indexOf('/');
         if (i != -1) {
             return mimeType.substring(0, i);
-        } else {
-            return mimeType;
         }
+        return mimeType;
     }
 
     @Override
@@ -78,9 +77,8 @@ public abstract class AbstractContentBod
         final int i = mimeType.indexOf('/');
         if (i != -1) {
             return mimeType.substring(i + 1);
-        } else {
-            return null;
         }
+        return null;
     }
 
     @Override



Mime
View raw message