From 0f87dceb80b432b434dbd81ed4f1ab97c740efc1 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Wed, 16 Nov 2016 16:45:53 -0800 Subject: [PATCH] Add final modifier to method parameters. --- .../java/org/apache/commons/lang3/StringUtils.java | 2 +- .../apache/commons/lang3/builder/EqualsBuilder.java | 10 +++++----- .../commons/lang3/builder/EqualsBuilderTest.java | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java b/src/main/java/org/apache/commons/lang3/StringUtils.java index 0d37d7070..00035b3d5 100644 --- a/src/main/java/org/apache/commons/lang3/StringUtils.java +++ b/src/main/java/org/apache/commons/lang3/StringUtils.java @@ -7432,7 +7432,7 @@ public class StringUtils { * @throws IllegalArgumentException if the width is too small * @since 2.0 */ - public static String abbreviate(final String str, int offset, final int maxWidth) { + public static String abbreviate(final String str, final int offset, final int maxWidth) { final String defaultAbbrevMarker = "..."; return abbreviate(str, defaultAbbrevMarker, offset, maxWidth); } diff --git a/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java b/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java index a58e79943..8d853b5ae 100644 --- a/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java +++ b/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java @@ -234,7 +234,7 @@ public class EqualsBuilder implements Builder { * @return EqualsBuilder - used to chain calls. * @since 3.6 */ - public EqualsBuilder setTestTransients(boolean testTransients) { + public EqualsBuilder setTestTransients(final boolean testTransients) { this.testTransients = testTransients; return this; } @@ -245,7 +245,7 @@ public class EqualsBuilder implements Builder { * @return EqualsBuilder - used to chain calls. * @since 3.6 */ - public EqualsBuilder setTestRecursive(boolean testRecursive) { + public EqualsBuilder setTestRecursive(final boolean testRecursive) { this.testRecursive = testRecursive; return this; } @@ -256,7 +256,7 @@ public class EqualsBuilder implements Builder { * @return EqualsBuilder - used to chain calls. * @since 3.6 */ - public EqualsBuilder setReflectUpToClass(Class reflectUpToClass) { + public EqualsBuilder setReflectUpToClass(final Class reflectUpToClass) { this.reflectUpToClass = reflectUpToClass; return this; } @@ -267,7 +267,7 @@ public class EqualsBuilder implements Builder { * @return EqualsBuilder - used to chain calls. * @since 3.6 */ - public EqualsBuilder setExcludeFields(String... excludeFields) { + public EqualsBuilder setExcludeFields(final String... excludeFields) { this.excludeFields = excludeFields; return this; } @@ -423,7 +423,7 @@ public class EqualsBuilder implements Builder { * @since 3.6 */ public static boolean reflectionEquals(final Object lhs, final Object rhs, final boolean testTransients, final Class reflectUpToClass, - boolean testRecursive, final String... excludeFields) { + final boolean testRecursive, final String... excludeFields) { if (lhs == rhs) { return true; } diff --git a/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java b/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java index a0cf9bbb0..f742d0a6d 100644 --- a/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java @@ -151,8 +151,8 @@ public class EqualsBuilderTest { private final TestRecursiveInnerObject b; private int z; - public TestRecursiveObject(TestRecursiveInnerObject a, - TestRecursiveInnerObject b, int z) { + public TestRecursiveObject(final TestRecursiveInnerObject a, + final TestRecursiveInnerObject b, final int z) { this.a = a; this.b = b; } @@ -173,7 +173,7 @@ public class EqualsBuilderTest { static class TestRecursiveInnerObject { private final int n; - public TestRecursiveInnerObject(int n) { + public TestRecursiveInnerObject(final int n) { this.n = n; } @@ -185,12 +185,12 @@ public class EqualsBuilderTest { static class TestRecursiveCycleObject { private TestRecursiveCycleObject cycle; private final int n; - public TestRecursiveCycleObject(int n) { + public TestRecursiveCycleObject(final int n) { this.n = n; this.cycle = this; } - public TestRecursiveCycleObject(TestRecursiveCycleObject cycle, int n) { + public TestRecursiveCycleObject(final TestRecursiveCycleObject cycle, final int n) { this.n = n; this.cycle = cycle; } @@ -203,7 +203,7 @@ public class EqualsBuilderTest { return cycle; } - public void setCycle(TestRecursiveCycleObject cycle) { + public void setCycle(final TestRecursiveCycleObject cycle) { this.cycle = cycle; } }