diff options
author | Benedikt Ritter <britter@apache.org> | 2017-06-06 16:11:45 +0200 |
---|---|---|
committer | Benedikt Ritter <britter@apache.org> | 2017-06-06 16:11:45 +0200 |
commit | 3a818ed6a833f083a2db9bb6804c1bdb43b9b0ec (patch) | |
tree | 680a77d6103b45639dcb878fc4c059db6b282c06 /src/test/java/org/apache/commons/lang3/builder | |
parent | 8a8b8ec8d244b18eeaf651d0ea6e84db579e7d92 (diff) | |
download | apache-commons-lang-3a818ed6a833f083a2db9bb6804c1bdb43b9b0ec.tar.gz |
Prevent redundant modifiers
Diffstat (limited to 'src/test/java/org/apache/commons/lang3/builder')
9 files changed, 55 insertions, 55 deletions
diff --git a/src/test/java/org/apache/commons/lang3/builder/CompareToBuilderTest.java b/src/test/java/org/apache/commons/lang3/builder/CompareToBuilderTest.java index 33deaa877..350b56775 100644 --- a/src/test/java/org/apache/commons/lang3/builder/CompareToBuilderTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/CompareToBuilderTest.java @@ -32,7 +32,7 @@ public class CompareToBuilderTest { static class TestObject implements Comparable<TestObject> { private int a; - public TestObject(final int a) { + TestObject(final int a) { this.a = a; } @Override @@ -67,10 +67,10 @@ public class CompareToBuilderTest { static class TestSubObject extends TestObject { private int b; - public TestSubObject() { + TestSubObject() { super(0); } - public TestSubObject(final int a, final int b) { + TestSubObject(final int a, final int b) { super(a); this.b = b; } @@ -90,7 +90,7 @@ public class CompareToBuilderTest { static class TestTransientSubObject extends TestObject { @SuppressWarnings("unused") private transient int t; - public TestTransientSubObject(final int a, final int t) { + TestTransientSubObject(final int a, final int t) { super(a); this.t = t; } diff --git a/src/test/java/org/apache/commons/lang3/builder/DiffResultTest.java b/src/test/java/org/apache/commons/lang3/builder/DiffResultTest.java index e18a7da58..a267a1b44 100644 --- a/src/test/java/org/apache/commons/lang3/builder/DiffResultTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/DiffResultTest.java @@ -36,11 +36,11 @@ public class DiffResultTest { private static class SimpleClass implements Diffable<SimpleClass> { private final boolean booleanField; - public SimpleClass(final boolean booleanField) { + SimpleClass(final boolean booleanField) { this.booleanField = booleanField; } - public static String getFieldName() { + static String getFieldName() { return "booleanField"; } 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 0e0f5f452..8be9b9815 100644 --- a/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java @@ -34,9 +34,9 @@ public class EqualsBuilderTest { static class TestObject { private int a; - public TestObject() { + TestObject() { } - public TestObject(final int a) { + TestObject(final int a) { this.a = a; } @Override @@ -67,10 +67,10 @@ public class EqualsBuilderTest { static class TestSubObject extends TestObject { private int b; - public TestSubObject() { + TestSubObject() { super(0); } - public TestSubObject(final int a, final int b) { + TestSubObject(final int a, final int b) { super(a); this.b = b; } @@ -101,7 +101,7 @@ public class EqualsBuilderTest { } static class TestEmptySubObject extends TestObject { - public TestEmptySubObject(final int a) { + TestEmptySubObject(final int a) { super(a); } } @@ -109,7 +109,7 @@ public class EqualsBuilderTest { static class TestTSubObject extends TestObject { @SuppressWarnings("unused") private transient int t; - public TestTSubObject(final int a, final int t) { + TestTSubObject(final int a, final int t) { super(a); this.t = t; } @@ -118,7 +118,7 @@ public class EqualsBuilderTest { static class TestTTSubObject extends TestTSubObject { @SuppressWarnings("unused") private transient int tt; - public TestTTSubObject(final int a, final int t, final int tt) { + TestTTSubObject(final int a, final int t, final int tt) { super(a, t); this.tt = tt; } @@ -127,7 +127,7 @@ public class EqualsBuilderTest { static class TestTTLeafObject extends TestTTSubObject { @SuppressWarnings("unused") private final int leafValue; - public TestTTLeafObject(final int a, final int t, final int tt, final int leafValue) { + TestTTLeafObject(final int a, final int t, final int tt, final int leafValue) { super(a, t, tt); this.leafValue = leafValue; } @@ -135,7 +135,7 @@ public class EqualsBuilderTest { static class TestTSubObject2 extends TestObject { private transient int t; - public TestTSubObject2(final int a, final int t) { + TestTSubObject2(final int a, final int t) { super(a); } public int getT() { @@ -151,7 +151,7 @@ public class EqualsBuilderTest { private final TestRecursiveInnerObject b; private int z; - public TestRecursiveObject(final TestRecursiveInnerObject a, + 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(final int n) { + 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(final int n) { + TestRecursiveCycleObject(final int n) { this.n = n; this.cycle = this; } - public TestRecursiveCycleObject(final TestRecursiveCycleObject cycle, final int n) { + TestRecursiveCycleObject(final TestRecursiveCycleObject cycle, final int n) { this.n = n; this.cycle = cycle; } @@ -1164,19 +1164,19 @@ public class EqualsBuilderTest { // doesn't barf on null, empty array, or non-existent field, but still tests as not equal assertFalse(EqualsBuilder.reflectionEquals(x1, x2, (String[]) null)); - assertFalse(EqualsBuilder.reflectionEquals(x1, x2, new String[] {})); - assertFalse(EqualsBuilder.reflectionEquals(x1, x2, new String[] {"xxx"})); + assertFalse(EqualsBuilder.reflectionEquals(x1, x2)); + assertFalse(EqualsBuilder.reflectionEquals(x1, x2, "xxx")); // not equal if only one of the differing fields excluded - assertFalse(EqualsBuilder.reflectionEquals(x1, x2, new String[] {"two"})); - assertFalse(EqualsBuilder.reflectionEquals(x1, x2, new String[] {"three"})); + assertFalse(EqualsBuilder.reflectionEquals(x1, x2, "two")); + assertFalse(EqualsBuilder.reflectionEquals(x1, x2, "three")); // equal if both differing fields excluded - assertTrue(EqualsBuilder.reflectionEquals(x1, x2, new String[] {"two", "three"})); + assertTrue(EqualsBuilder.reflectionEquals(x1, x2, "two", "three")); // still equal as long as both differing fields are among excluded - assertTrue(EqualsBuilder.reflectionEquals(x1, x2, new String[] {"one", "two", "three"})); - assertTrue(EqualsBuilder.reflectionEquals(x1, x2, new String[] {"one", "two", "three", "xxx"})); + assertTrue(EqualsBuilder.reflectionEquals(x1, x2, "one", "two", "three")); + assertTrue(EqualsBuilder.reflectionEquals(x1, x2, "one", "two", "three", "xxx")); } static class TestObjectWithMultipleFields { @@ -1187,7 +1187,7 @@ public class EqualsBuilderTest { @SuppressWarnings("unused") private final TestObject three; - public TestObjectWithMultipleFields(final int one, final int two, final int three) { + TestObjectWithMultipleFields(final int one, final int two, final int three) { this.one = new TestObject(one); this.two = new TestObject(two); this.three = new TestObject(three); @@ -1229,7 +1229,7 @@ public class EqualsBuilderTest { @SuppressWarnings("unused") private final TestObject one; - public TestObjectReference(final int one) { + TestObjectReference(final int one) { this.one = new TestObject(one); } @@ -1271,7 +1271,7 @@ public class EqualsBuilderTest { private final int a; private final int b; - public TestObjectEqualsExclude(final int a, final int b) { + TestObjectEqualsExclude(final int a, final int b) { this.a = a; this.b = b; } diff --git a/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderTest.java b/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderTest.java index 03b166acc..3e00cd068 100644 --- a/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderTest.java @@ -75,7 +75,7 @@ public class HashCodeBuilderTest { static class TestObject { private int a; - public TestObject(final int a) { + TestObject(final int a) { this.a = a; } @@ -111,11 +111,11 @@ public class HashCodeBuilderTest { @SuppressWarnings("unused") private transient int t; - public TestSubObject() { + TestSubObject() { super(0); } - public TestSubObject(final int a, final int b, final int t) { + TestSubObject(final int a, final int b, final int t) { super(a); this.b = b; this.t = t; @@ -491,16 +491,16 @@ public class HashCodeBuilderTest { assertEquals(((17 * 37 + 1) * 37 + 2) * 37 + 3, HashCodeBuilder.reflectionHashCode(x)); assertEquals(((17 * 37 + 1) * 37 + 2) * 37 + 3, HashCodeBuilder.reflectionHashCode(x, (String[]) null)); - assertEquals(((17 * 37 + 1) * 37 + 2) * 37 + 3, HashCodeBuilder.reflectionHashCode(x, new String[]{})); - assertEquals(((17 * 37 + 1) * 37 + 2) * 37 + 3, HashCodeBuilder.reflectionHashCode(x, new String[]{"xxx"})); + assertEquals(((17 * 37 + 1) * 37 + 2) * 37 + 3, HashCodeBuilder.reflectionHashCode(x)); + assertEquals(((17 * 37 + 1) * 37 + 2) * 37 + 3, HashCodeBuilder.reflectionHashCode(x, "xxx")); - assertEquals((17 * 37 + 1) * 37 + 3, HashCodeBuilder.reflectionHashCode(x, new String[]{"two"})); - assertEquals((17 * 37 + 1) * 37 + 2, HashCodeBuilder.reflectionHashCode(x, new String[]{"three"})); + assertEquals((17 * 37 + 1) * 37 + 3, HashCodeBuilder.reflectionHashCode(x, "two")); + assertEquals((17 * 37 + 1) * 37 + 2, HashCodeBuilder.reflectionHashCode(x, "three")); - assertEquals(17 * 37 + 1, HashCodeBuilder.reflectionHashCode(x, new String[]{"two", "three"})); + assertEquals(17 * 37 + 1, HashCodeBuilder.reflectionHashCode(x, "two", "three")); - assertEquals(17, HashCodeBuilder.reflectionHashCode(x, new String[]{"one", "two", "three"})); - assertEquals(17, HashCodeBuilder.reflectionHashCode(x, new String[]{"one", "two", "three", "xxx"})); + assertEquals(17, HashCodeBuilder.reflectionHashCode(x, "one", "two", "three")); + assertEquals(17, HashCodeBuilder.reflectionHashCode(x, "one", "two", "three", "xxx")); } static class TestObjectWithMultipleFields { @@ -513,7 +513,7 @@ public class HashCodeBuilderTest { @SuppressWarnings("unused") private int three = 0; - public TestObjectWithMultipleFields(final int one, final int two, final int three) { + TestObjectWithMultipleFields(final int one, final int two, final int three) { this.one = one; this.two = two; this.three = three; @@ -568,7 +568,7 @@ public class HashCodeBuilderTest { private final int a; private final int b; - public TestObjectHashCodeExclude(final int a, final int b) { + TestObjectHashCodeExclude(final int a, final int b) { this.a = a; this.b = b; } @@ -588,7 +588,7 @@ public class HashCodeBuilderTest { @HashCodeExclude private final int b; - public TestObjectHashCodeExclude2(final int a, final int b) { + TestObjectHashCodeExclude2(final int a, final int b) { this.a = a; this.b = b; } diff --git a/src/test/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyleTest.java b/src/test/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyleTest.java index cb08ae01e..372e2d849 100644 --- a/src/test/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyleTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyleTest.java @@ -235,7 +235,7 @@ public class MultilineRecursiveToStringStyleTest { static class Bank { String name; - public Bank(final String name) { + Bank(final String name) { this.name = name; } } @@ -245,7 +245,7 @@ public class MultilineRecursiveToStringStyleTest { Bank bank; List<Account> accounts; - public Customer(final String name) { + Customer(final String name) { this.name = name; } } @@ -267,7 +267,7 @@ public class MultilineRecursiveToStringStyleTest { double amount; String date; - public Transaction(final String datum, final double betrag) { + Transaction(final String datum, final double betrag) { this.date = datum; this.amount = betrag; } diff --git a/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeNullValuesTest.java b/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeNullValuesTest.java index 4250ddf18..914700a67 100644 --- a/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeNullValuesTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeNullValuesTest.java @@ -30,7 +30,7 @@ public class ReflectionToStringBuilderExcludeNullValuesTest { @SuppressWarnings("unused") private String testStringField; - public TestFixture(Integer a, String b) { + TestFixture(Integer a, String b) { this.testIntegerField = a; this.testStringField = b; } diff --git a/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeTest.java b/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeTest.java index aa8909e5b..005f4b855 100644 --- a/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderExcludeTest.java @@ -54,7 +54,7 @@ public class ReflectionToStringBuilderExcludeTest { @Test public void test_toStringExcludeArray() { - final String toString = ReflectionToStringBuilder.toStringExclude(new TestFixture(), new String[]{SECRET_FIELD}); + final String toString = ReflectionToStringBuilder.toStringExclude(new TestFixture(), SECRET_FIELD); this.validateSecretFieldAbsent(toString); } @@ -66,7 +66,7 @@ public class ReflectionToStringBuilderExcludeTest { @Test public void test_toStringExcludeArrayWithNulls() { - final String toString = ReflectionToStringBuilder.toStringExclude(new TestFixture(), new String[]{null, null}); + final String toString = ReflectionToStringBuilder.toStringExclude(new TestFixture(), null, null); this.validateSecretFieldPresent(toString); } diff --git a/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderMutateInspectConcurrencyTest.java b/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderMutateInspectConcurrencyTest.java index 85ab700dc..34788e0ea 100644 --- a/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderMutateInspectConcurrencyTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderMutateInspectConcurrencyTest.java @@ -41,7 +41,7 @@ public class ReflectionToStringBuilderMutateInspectConcurrencyTest { private final Random random = new Random(); private final int N = 100; - public TestFixture() { + TestFixture() { synchronized (this) { for (int i = 0; i < N; i++) { listField.add(Integer.valueOf(i)); @@ -62,7 +62,7 @@ public class ReflectionToStringBuilderMutateInspectConcurrencyTest { private final TestFixture testFixture; private final Random random = new Random(); - public MutatingClient(final TestFixture testFixture) { + MutatingClient(final TestFixture testFixture) { this.testFixture = testFixture; } @@ -79,7 +79,7 @@ public class ReflectionToStringBuilderMutateInspectConcurrencyTest { class InspectingClient implements Runnable { private final TestFixture testFixture; - public InspectingClient(final TestFixture testFixture) { + InspectingClient(final TestFixture testFixture) { this.testFixture = testFixture; } diff --git a/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java b/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java index 619b9f255..1e805bec7 100644 --- a/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java @@ -472,10 +472,10 @@ public class ToStringBuilderTest { static class SimpleReflectionTestFixture { Object o; - public SimpleReflectionTestFixture() { + SimpleReflectionTestFixture() { } - public SimpleReflectionTestFixture(final Object o) { + SimpleReflectionTestFixture(final Object o) { this.o = o; } @@ -489,7 +489,7 @@ public class ToStringBuilderTest { @SuppressWarnings("unused") private final SelfInstanceVarReflectionTestFixture typeIsSelf; - public SelfInstanceVarReflectionTestFixture() { + SelfInstanceVarReflectionTestFixture() { this.typeIsSelf = this; } @@ -504,7 +504,7 @@ public class ToStringBuilderTest { private final SelfInstanceTwoVarsReflectionTestFixture typeIsSelf; private final String otherType = "The Other Type"; - public SelfInstanceTwoVarsReflectionTestFixture() { + SelfInstanceTwoVarsReflectionTestFixture() { this.typeIsSelf = this; } |