You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by br...@apache.org on 2015/04/19 17:14:59 UTC

[10/12] [text] Condition will always be true

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/SANDBOX-498
Commit: b1c7e564251e7a404aa3d021c282349150fd4061
Parents: ed985cd
Author: Benedikt Ritter <br...@apache.org>
Authored: Sun Apr 19 16:45:49 2015 +0200
Committer: Benedikt Ritter <br...@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.");
         }
     }