commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ki...@apache.org
Subject [10/13] [text] Condition will always be true
Date Mon, 20 Apr 2015 02:59:07 GMT
Condition will always be true


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

Branch: refs/heads/master
Commit: b1c7e564251e7a404aa3d021c282349150fd4061
Parents: ed985cd
Author: Benedikt Ritter <britter@apache.org>
Authored: Sun Apr 19 16:45:49 2015 +0200
Committer: Benedikt Ritter <britter@apache.org>
Committed: Sun Apr 19 16:45:49 2015 +0200

----------------------------------------------------------------------
 .../org/apache/commons/text/names/NameString.java     | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-text/blob/b1c7e564/src/main/java/org/apache/commons/text/names/NameString.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/text/names/NameString.java b/src/main/java/org/apache/commons/text/names/NameString.java
index 54e2753..21898d3 100644
--- a/src/main/java/org/apache/commons/text/names/NameString.java
+++ b/src/main/java/org/apache/commons/text/names/NameString.java
@@ -98,14 +98,12 @@ final class NameString {
      */
     void flip(String flipAroundChar) {
         String[] parts = this.str.split(flipAroundChar);
-        if (parts != null) {
-            if (parts.length == 2) {
-                this.str = String.format("%s %s", parts[1], parts[0]);
-                this.norm();
-            } else if (parts.length > 2) {
-                throw new NameParseException(
-                        "Can't flip around multiple '" + flipAroundChar + "' characters in
namestring.");
-            }
+        if (parts.length == 2) {
+            this.str = String.format("%s %s", parts[1], parts[0]);
+            this.norm();
+        } else if (parts.length > 2) {
+            throw new NameParseException(
+                    "Can't flip around multiple '" + flipAroundChar + "' characters in namestring.");
         }
     }
 


Mime
View raw message