commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject [08/11] [lang] Variable names should follow naming conventions
Date Fri, 01 May 2015 21:57:04 GMT
Variable names should follow naming conventions


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

Branch: refs/heads/master
Commit: 07ec8ad2dd862c8669b2557b995ec5180663d73f
Parents: 448ec93
Author: Benedikt Ritter <britter@apache.org>
Authored: Fri May 1 23:48:35 2015 +0200
Committer: Benedikt Ritter <britter@apache.org>
Committed: Fri May 1 23:48:35 2015 +0200

----------------------------------------------------------------------
 .../java/org/apache/commons/lang3/builder/ToStringStyle.java | 8 ++++----
 .../apache/commons/lang3/builder/JsonToStringStyleTest.java  | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/07ec8ad2/src/main/java/org/apache/commons/lang3/builder/ToStringStyle.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/builder/ToStringStyle.java b/src/main/java/org/apache/commons/lang3/builder/ToStringStyle.java
index 6f51e1c..c404a02 100644
--- a/src/main/java/org/apache/commons/lang3/builder/ToStringStyle.java
+++ b/src/main/java/org/apache/commons/lang3/builder/ToStringStyle.java
@@ -2585,16 +2585,16 @@ public abstract class ToStringStyle implements Serializable {
             	return;
             }
             
-            final String try_value_str = value.toString();
-            if (try_value_str.startsWith(getContentStart()) && try_value_str.endsWith(getContentEnd())
-                    || try_value_str.startsWith(getArrayStart()) && try_value_str.startsWith(getArrayEnd())
+            final String valueAsString = value.toString();
+            if (valueAsString.startsWith(getContentStart()) && valueAsString.endsWith(getContentEnd())
+                    || valueAsString.startsWith(getArrayStart()) && valueAsString.startsWith(getArrayEnd())
                 ) {
                 
             	buffer.append(value);
             	return;
             }
             
-            appendDetail(buffer, fieldName, try_value_str);
+            appendDetail(buffer, fieldName, valueAsString);
         }
 
         /**

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/07ec8ad2/src/test/java/org/apache/commons/lang3/builder/JsonToStringStyleTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/builder/JsonToStringStyleTest.java b/src/test/java/org/apache/commons/lang3/builder/JsonToStringStyleTest.java
index 4d23d53..e5821d5 100644
--- a/src/test/java/org/apache/commons/lang3/builder/JsonToStringStyleTest.java
+++ b/src/test/java/org/apache/commons/lang3/builder/JsonToStringStyleTest.java
@@ -111,7 +111,7 @@ public class JsonToStringStyleTest {
     public void testDate() {
         
         final Date now = new Date();
-        final Date after_now = new Date(System.currentTimeMillis() + 1);
+        final Date afterNow = new Date(System.currentTimeMillis() + 1);
         
         try {
             new ToStringBuilder(base).append(now).toString();
@@ -121,7 +121,7 @@ public class JsonToStringStyleTest {
         
         assertEquals("{\"now\":\"" + now.toString() +"\"}", new ToStringBuilder(base).append("now",
now)
                 .toString());
-        assertEquals("{\"now\":\"" + now.toString() +"\",\"after\":\"" + after_now.toString()
+ "\"}", new ToStringBuilder(base).append("now", now).append("after", after_now)
+        assertEquals("{\"now\":\"" + now.toString() +"\",\"after\":\"" + afterNow.toString()
+ "\"}", new ToStringBuilder(base).append("now", now).append("after", afterNow)
                 .toString());
     }
 


Mime
View raw message