commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pascalschumac...@apache.org
Subject [3/3] [lang] MultilineRecursiveToStringStyle: made private field indent static
Date Fri, 20 Jan 2017 17:48:44 GMT
MultilineRecursiveToStringStyle: made private field indent static


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

Branch: refs/heads/master
Commit: 86a082e8be8c51f07079ded82d6d125c9efc1791
Parents: bd7788b
Author: pascalschumacher <pascalschumacher@gmx.net>
Authored: Fri Jan 20 18:48:13 2017 +0100
Committer: pascalschumacher <pascalschumacher@gmx.net>
Committed: Fri Jan 20 18:48:13 2017 +0100

----------------------------------------------------------------------
 .../MultilineRecursiveToStringStyle.java        | 50 ++++++++++----------
 1 file changed, 25 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/86a082e8/src/main/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyle.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyle.java
b/src/main/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyle.java
index 311a698..df82787 100644
--- a/src/main/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyle.java
+++ b/src/main/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyle.java
@@ -70,7 +70,7 @@ public class MultilineRecursiveToStringStyle extends RecursiveToStringStyle
{
     private static final long serialVersionUID = 1L;
 
     /** Indenting of inner lines. */
-    private final int indent = 2;
+    private static final int INDENT = 2;
 
     /** Current indenting. */
     private int spaces = 2;
@@ -90,11 +90,11 @@ public class MultilineRecursiveToStringStyle extends RecursiveToStringStyle
{
     private void resetIndent() {
         setArrayStart("{" + System.lineSeparator() + spacer(spaces));
         setArraySeparator("," + System.lineSeparator() + spacer(spaces));
-        setArrayEnd(System.lineSeparator() + spacer(spaces - indent) + "}");
+        setArrayEnd(System.lineSeparator() + spacer(spaces - INDENT) + "}");
 
         setContentStart("[" + System.lineSeparator() + spacer(spaces));
         setFieldSeparator("," + System.lineSeparator() + spacer(spaces));
-        setContentEnd(System.lineSeparator() + spacer(spaces - indent) + "]");
+        setContentEnd(System.lineSeparator() + spacer(spaces - INDENT) + "]");
     }
 
     /**
@@ -115,10 +115,10 @@ public class MultilineRecursiveToStringStyle extends RecursiveToStringStyle
{
     public void appendDetail(final StringBuffer buffer, final String fieldName, final Object
value) {
         if (!ClassUtils.isPrimitiveWrapper(value.getClass()) && !String.class.equals(value.getClass())
                 && accept(value.getClass())) {
-            spaces += indent;
+            spaces += INDENT;
             resetIndent();
             buffer.append(ReflectionToStringBuilder.toString(value, this));
-            spaces -= indent;
+            spaces -= INDENT;
             resetIndent();
         } else {
             super.appendDetail(buffer, fieldName, value);
@@ -127,91 +127,91 @@ public class MultilineRecursiveToStringStyle extends RecursiveToStringStyle
{
 
     @Override
     protected void appendDetail(final StringBuffer buffer, final String fieldName, final
Object[] array) {
-        spaces += indent;
+        spaces += INDENT;
         resetIndent();
         super.appendDetail(buffer, fieldName, array);
-        spaces -= indent;
+        spaces -= INDENT;
         resetIndent();
     }
 
     @Override
     protected void reflectionAppendArrayDetail(final StringBuffer buffer, final String fieldName,
final Object array) {
-        spaces += indent;
+        spaces += INDENT;
         resetIndent();
         super.appendDetail(buffer, fieldName, array);
-        spaces -= indent;
+        spaces -= INDENT;
         resetIndent();
     }
 
     @Override
     protected void appendDetail(final StringBuffer buffer, final String fieldName, final
long[] array) {
-        spaces += indent;
+        spaces += INDENT;
         resetIndent();
         super.appendDetail(buffer, fieldName, array);
-        spaces -= indent;
+        spaces -= INDENT;
         resetIndent();
     }
 
     @Override
     protected void appendDetail(final StringBuffer buffer, final String fieldName, final
int[] array) {
-        spaces += indent;
+        spaces += INDENT;
         resetIndent();
         super.appendDetail(buffer, fieldName, array);
-        spaces -= indent;
+        spaces -= INDENT;
         resetIndent();
     }
 
     @Override
     protected void appendDetail(final StringBuffer buffer, final String fieldName, final
short[] array) {
-        spaces += indent;
+        spaces += INDENT;
         resetIndent();
         super.appendDetail(buffer, fieldName, array);
-        spaces -= indent;
+        spaces -= INDENT;
         resetIndent();
     }
 
     @Override
     protected void appendDetail(final StringBuffer buffer, final String fieldName, final
byte[] array) {
-        spaces += indent;
+        spaces += INDENT;
         resetIndent();
         super.appendDetail(buffer, fieldName, array);
-        spaces -= indent;
+        spaces -= INDENT;
         resetIndent();
     }
 
     @Override
     protected void appendDetail(final StringBuffer buffer, final String fieldName, final
char[] array) {
-        spaces += indent;
+        spaces += INDENT;
         resetIndent();
         super.appendDetail(buffer, fieldName, array);
-        spaces -= indent;
+        spaces -= INDENT;
         resetIndent();
     }
 
     @Override
     protected void appendDetail(final StringBuffer buffer, final String fieldName, final
double[] array) {
-        spaces += indent;
+        spaces += INDENT;
         resetIndent();
         super.appendDetail(buffer, fieldName, array);
-        spaces -= indent;
+        spaces -= INDENT;
         resetIndent();
     }
 
     @Override
     protected void appendDetail(final StringBuffer buffer, final String fieldName, final
float[] array) {
-        spaces += indent;
+        spaces += INDENT;
         resetIndent();
         super.appendDetail(buffer, fieldName, array);
-        spaces -= indent;
+        spaces -= INDENT;
         resetIndent();
     }
 
     @Override
     protected void appendDetail(final StringBuffer buffer, final String fieldName, final
boolean[] array) {
-        spaces += indent;
+        spaces += INDENT;
         resetIndent();
         super.appendDetail(buffer, fieldName, array);
-        spaces -= indent;
+        spaces -= INDENT;
         resetIndent();
     }
 


Mime
View raw message