From ae1d3c5c4c2b21ff0c859b33c9f53172c76526f6 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Thu, 12 Sep 2024 10:20:52 -0400 Subject: [PATCH] Remove redundant syntax --- .../commons/lang3/builder/ToStringStyle.java | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) 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 c3796dad2..df7fff831 100644 --- a/src/main/java/org/apache/commons/lang3/builder/ToStringStyle.java +++ b/src/main/java/org/apache/commons/lang3/builder/ToStringStyle.java @@ -127,25 +127,25 @@ public abstract class ToStringStyle implements Serializable { *

*/ JsonToStringStyle() { - this.setUseClassName(false); - this.setUseIdentityHashCode(false); + setUseClassName(false); + setUseIdentityHashCode(false); - this.setContentStart("{"); - this.setContentEnd("}"); + setContentStart("{"); + setContentEnd("}"); - this.setArrayStart("["); - this.setArrayEnd("]"); + setArrayStart("["); + setArrayEnd("]"); - this.setFieldSeparator(","); - this.setFieldNameValueSeparator(":"); + setFieldSeparator(","); + setFieldNameValueSeparator(":"); - this.setNullText("null"); + setNullText("null"); - this.setSummaryObjectStartText("\"<"); - this.setSummaryObjectEndText(">\""); + setSummaryObjectStartText("\"<"); + setSummaryObjectEndText(">\""); - this.setSizeStartText("\"\""); + setSizeStartText("\"\""); } @Override @@ -445,10 +445,10 @@ public abstract class ToStringStyle implements Serializable { *

Use the static constant rather than instantiating.

*/ MultiLineToStringStyle() { - this.setContentStart("["); - this.setFieldSeparator(System.lineSeparator() + " "); - this.setFieldSeparatorAtStart(true); - this.setContentEnd(System.lineSeparator() + "]"); + setContentStart("["); + setFieldSeparator(System.lineSeparator() + " "); + setFieldSeparatorAtStart(true); + setContentEnd(System.lineSeparator() + "]"); } /** @@ -479,8 +479,8 @@ public abstract class ToStringStyle implements Serializable { *

Use the static constant rather than instantiating.

*/ NoClassNameToStringStyle() { - this.setUseClassName(false); - this.setUseIdentityHashCode(false); + setUseClassName(false); + setUseIdentityHashCode(false); } /** @@ -511,7 +511,7 @@ public abstract class ToStringStyle implements Serializable { *

Use the static constant rather than instantiating.

*/ NoFieldNameToStringStyle() { - this.setUseFieldNames(false); + setUseFieldNames(false); } /** @@ -542,8 +542,8 @@ public abstract class ToStringStyle implements Serializable { *

Use the static constant rather than instantiating.

*/ ShortPrefixToStringStyle() { - this.setUseShortClassName(true); - this.setUseIdentityHashCode(false); + setUseShortClassName(true); + setUseIdentityHashCode(false); } /** @@ -573,11 +573,11 @@ public abstract class ToStringStyle implements Serializable { *

Use the static constant rather than instantiating.

*/ SimpleToStringStyle() { - this.setUseClassName(false); - this.setUseIdentityHashCode(false); - this.setUseFieldNames(false); - this.setContentStart(StringUtils.EMPTY); - this.setContentEnd(StringUtils.EMPTY); + setUseClassName(false); + setUseIdentityHashCode(false); + setUseFieldNames(false); + setContentStart(StringUtils.EMPTY); + setContentEnd(StringUtils.EMPTY); } /** @@ -1667,7 +1667,7 @@ public abstract class ToStringStyle implements Serializable { * @param object the {@link Object} whose id to output */ protected void appendIdentityHashCode(final StringBuffer buffer, final Object object) { - if (this.isUseIdentityHashCode() && object != null) { + if (isUseIdentityHashCode() && object != null) { register(object); buffer.append('@'); buffer.append(ObjectUtils.identityHashCodeHex(object));