commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [06/46] commons-compress git commit: Statement unnecessarily nested within else clause.
Date Sun, 10 Apr 2016 04:18:22 GMT
Statement unnecessarily nested within else clause.

Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/d378ed45
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/d378ed45
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/d378ed45

Branch: refs/heads/COMPRESS-207
Commit: d378ed45084b93c481d597152054800a2a829154
Parents: 18dcf38
Author: ggregory <ggregory@apache.org>
Authored: Wed Apr 6 10:21:39 2016 -0700
Committer: ggregory <ggregory@apache.org>
Committed: Wed Apr 6 10:21:39 2016 -0700

----------------------------------------------------------------------
 .../archivers/ArchiveStreamFactory.java         | 27 +++++++-------------
 1 file changed, 9 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/d378ed45/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java
b/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java
index 28fe13b..b69cada 100644
--- a/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java
+++ b/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java
@@ -209,44 +209,38 @@ public class ArchiveStreamFactory {
         if (ARJ.equalsIgnoreCase(archiverName)) {
             if (entryEncoding != null) {
                 return new ArjArchiveInputStream(in, entryEncoding);
-            } else {
-                return new ArjArchiveInputStream(in);
             }
+            return new ArjArchiveInputStream(in);
         }
         if (ZIP.equalsIgnoreCase(archiverName)) {
             if (entryEncoding != null) {
                 return new ZipArchiveInputStream(in, entryEncoding);
-            } else {
-                return new ZipArchiveInputStream(in);
             }
+            return new ZipArchiveInputStream(in);
         }
         if (TAR.equalsIgnoreCase(archiverName)) {
             if (entryEncoding != null) {
                 return new TarArchiveInputStream(in, entryEncoding);
-            } else {
-                return new TarArchiveInputStream(in);
             }
+            return new TarArchiveInputStream(in);
         }
         if (JAR.equalsIgnoreCase(archiverName)) {
             if (entryEncoding != null) {
                 return new JarArchiveInputStream(in, entryEncoding);
-            } else {
-                return new JarArchiveInputStream(in);
             }
+            return new JarArchiveInputStream(in);
         }
         if (CPIO.equalsIgnoreCase(archiverName)) {
             if (entryEncoding != null) {
                 return new CpioArchiveInputStream(in, entryEncoding);
-            } else {
-                return new CpioArchiveInputStream(in);
             }
+            return new CpioArchiveInputStream(in);
         }
         if (DUMP.equalsIgnoreCase(archiverName)) {
             if (entryEncoding != null) {
                 return new DumpArchiveInputStream(in, entryEncoding);
-            } else {
-                return new DumpArchiveInputStream(in);
             }
+            return new DumpArchiveInputStream(in);
         }
         if (SEVEN_Z.equalsIgnoreCase(archiverName)) {
             throw new StreamingNotSupportedException(SEVEN_Z);
@@ -290,23 +284,20 @@ public class ArchiveStreamFactory {
         if (TAR.equalsIgnoreCase(archiverName)) {
             if (entryEncoding != null) {
                 return new TarArchiveOutputStream(out, entryEncoding);
-            } else {
-                return new TarArchiveOutputStream(out);
             }
+            return new TarArchiveOutputStream(out);
         }
         if (JAR.equalsIgnoreCase(archiverName)) {
             if (entryEncoding != null) {
                 return new JarArchiveOutputStream(out, entryEncoding);
-            } else {
-                return new JarArchiveOutputStream(out);
             }
+            return new JarArchiveOutputStream(out);
         }
         if (CPIO.equalsIgnoreCase(archiverName)) {
             if (entryEncoding != null) {
                 return new CpioArchiveOutputStream(out, entryEncoding);
-            } else {
-                return new CpioArchiveOutputStream(out);
             }
+            return new CpioArchiveOutputStream(out);
         }
         if (SEVEN_Z.equalsIgnoreCase(archiverName)) {
             throw new StreamingNotSupportedException(SEVEN_Z);


Mime
View raw message