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

[text] Renaming variables to simpler names

Repository: commons-text
Updated Branches:
  refs/heads/SANDBOX-498-KINOW [created] c5785647e


Renaming variables to simpler names


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

Branch: refs/heads/SANDBOX-498-KINOW
Commit: c5785647efbb802cdfc5fc74dc1ee4457ca525d0
Parents: c4e8a3e
Author: Bruno P. Kinoshita <br...@yahoo.com.br>
Authored: Sun Apr 19 22:17:15 2015 +1200
Committer: Bruno P. Kinoshita <br...@yahoo.com.br>
Committed: Sun Apr 19 22:17:15 2015 +1200

----------------------------------------------------------------------
 .../commons/text/names/HumanNameParser.java     | 26 ++++++++++----------
 1 file changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-text/blob/c5785647/src/main/java/org/apache/commons/text/names/HumanNameParser.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/text/names/HumanNameParser.java b/src/main/java/org/apache/commons/text/names/HumanNameParser.java
index 843685a..659ec95 100644
--- a/src/main/java/org/apache/commons/text/names/HumanNameParser.java
+++ b/src/main/java/org/apache/commons/text/names/HumanNameParser.java
@@ -75,7 +75,7 @@ public class HumanNameParser {
     /**
      * First name.
      */
-    private String first;
+    private String firstName;
     /**
      * Single nickname found in the name input.
      */
@@ -83,11 +83,11 @@ public class HumanNameParser {
     /**
      * Middle name.
      */
-    private String middle;
+    private String middleName;
     /**
      * Last name.
      */
-    private String last;
+    private String lastName;
     /**
      * Name suffix.
      */
@@ -119,10 +119,10 @@ public class HumanNameParser {
         this.name = name;
 
         this.leadingInit = "";
-        this.first = "";
+        this.firstName = "";
         this.nickname = "";
-        this.middle = "";
-        this.last = "";
+        this.middleName = "";
+        this.lastName = "";
         this.suffix = "";
 
         this.suffixes = Arrays.asList(new String[] {
@@ -162,7 +162,7 @@ public class HumanNameParser {
      * @return first name
      */
     public String getFirst() {
-        return first;
+        return firstName;
     }
 
     /**
@@ -180,7 +180,7 @@ public class HumanNameParser {
      * @return the middle name
      */
     public String getMiddle() {
-        return middle;
+        return middleName;
     }
 
     /**
@@ -189,7 +189,7 @@ public class HumanNameParser {
      * @return the last name
      */
     public String getLast() {
-        return last;
+        return lastName;
     }
 
     /**
@@ -249,19 +249,19 @@ public class HumanNameParser {
         this.name.flip(",");
 
         // get the last name
-        this.last = this.name.chopWithRegex(lastRegex, 0);
+        this.lastName = this.name.chopWithRegex(lastRegex, 0);
 
         // get the first initial, if there is one
         this.leadingInit = this.name.chopWithRegex(leadingInitRegex, 1);
 
         // get the first name
-        this.first = this.name.chopWithRegex(firstRegex, 0);
-        if (StringUtils.isBlank(this.first)) {
+        this.firstName = this.name.chopWithRegex(firstRegex, 0);
+        if (StringUtils.isBlank(this.firstName)) {
             throw new NameParseException("Couldn't find a first name in '{" + this.name.getStr() + "}'");
         }
 
         // if anything's left, that's the middle name
-        this.middle = this.name.getStr();
+        this.middleName = this.name.getStr();
     }
 
 }