This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-lang.git
The following commit(s) were added to refs/heads/master by this push: new 196761352 Use final, remove redundant call to super(), use valueOf(), lambdas. 196761352 is described below commit 19676135286eca93ab4f3980ddb5aa7ffba43bed Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Wed Jun 15 15:25:10 2022 -0400 Use final, remove redundant call to super(), use valueOf(), lambdas. --- src/test/java/org/apache/commons/lang3/ClassUtilsTest.java | 2 +- src/test/java/org/apache/commons/lang3/ConversionTest.java | 2 +- src/test/java/org/apache/commons/lang3/EnumUtilsTest.java | 2 +- .../java/org/apache/commons/lang3/builder/DiffBuilderTest.java | 4 ++-- .../org/apache/commons/lang3/exception/CustomCheckedException.java | 7 +++---- .../apache/commons/lang3/exception/CustomUncheckedException.java | 7 +++---- src/test/java/org/apache/commons/lang3/function/ConsumersTest.java | 6 +++--- src/test/java/org/apache/commons/lang3/stream/StreamsTest.java | 2 +- .../java/org/apache/commons/lang3/time/DateFormatUtilsTest.java | 4 ++-- src/test/java/org/apache/commons/lang3/time/DurationUtilsTest.java | 2 +- 10 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/test/java/org/apache/commons/lang3/ClassUtilsTest.java b/src/test/java/org/apache/commons/lang3/ClassUtilsTest.java index 3c3856b91..73c7c61c3 100644 --- a/src/test/java/org/apache/commons/lang3/ClassUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/ClassUtilsTest.java @@ -1269,7 +1269,7 @@ public class ClassUtilsTest { assertEquals(Inner.DeeplyNested.class, ClassUtils.getClass("org.apache.commons.lang3.ClassUtilsTest$Inner$DeeplyNested", true)); assertEquals(Inner.DeeplyNested.class, ClassUtils.getClass("org.apache.commons.lang3.ClassUtilsTest$Inner.DeeplyNested", true)); // - ClassLoader classLoader = Inner.DeeplyNested.class.getClassLoader(); + final ClassLoader classLoader = Inner.DeeplyNested.class.getClassLoader(); assertEquals(Inner.DeeplyNested.class, ClassUtils.getClass(classLoader, "org.apache.commons.lang3.ClassUtilsTest.Inner.DeeplyNested")); assertEquals(Inner.DeeplyNested.class, ClassUtils.getClass(classLoader, "org.apache.commons.lang3.ClassUtilsTest.Inner$DeeplyNested")); assertEquals(Inner.DeeplyNested.class, ClassUtils.getClass(classLoader, "org.apache.commons.lang3.ClassUtilsTest$Inner$DeeplyNested")); diff --git a/src/test/java/org/apache/commons/lang3/ConversionTest.java b/src/test/java/org/apache/commons/lang3/ConversionTest.java index db9794ac2..18f55615d 100644 --- a/src/test/java/org/apache/commons/lang3/ConversionTest.java +++ b/src/test/java/org/apache/commons/lang3/ConversionTest.java @@ -437,7 +437,7 @@ public class ConversionTest { @ParameterizedTest @ValueSource(ints = {-1, 8, 99}) - public void binaryBeMsb0ToHexDigitPosOutsideArray(int index) { + public void binaryBeMsb0ToHexDigitPosOutsideArray(final int index) { assertThrows(IndexOutOfBoundsException.class, () -> Conversion.binaryBeMsb0ToHexDigit(new boolean[8], index)); } diff --git a/src/test/java/org/apache/commons/lang3/EnumUtilsTest.java b/src/test/java/org/apache/commons/lang3/EnumUtilsTest.java index 531af8488..892a1e5a3 100644 --- a/src/test/java/org/apache/commons/lang3/EnumUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/EnumUtilsTest.java @@ -580,7 +580,7 @@ enum Month { private final int id; - Month(int id) { + Month(final int id) { this.id = id; } diff --git a/src/test/java/org/apache/commons/lang3/builder/DiffBuilderTest.java b/src/test/java/org/apache/commons/lang3/builder/DiffBuilderTest.java index a9e62de23..afa2c7cfa 100644 --- a/src/test/java/org/apache/commons/lang3/builder/DiffBuilderTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/DiffBuilderTest.java @@ -356,9 +356,9 @@ public class DiffBuilderTest { @Test public void testObjectsNotSameButEqual() { final TypeTestClass left = new TypeTestClass(); - left.objectField = new Integer(1); + left.objectField = Integer.valueOf(1000); final TypeTestClass right = new TypeTestClass(); - right.objectField = new Integer(1); + right.objectField = Integer.valueOf(1000); assertNotSame(left.objectField, right.objectField); assertEquals(left.objectField, right.objectField); diff --git a/src/test/java/org/apache/commons/lang3/exception/CustomCheckedException.java b/src/test/java/org/apache/commons/lang3/exception/CustomCheckedException.java index ba7829355..fe8b1e67e 100644 --- a/src/test/java/org/apache/commons/lang3/exception/CustomCheckedException.java +++ b/src/test/java/org/apache/commons/lang3/exception/CustomCheckedException.java @@ -22,18 +22,17 @@ public class CustomCheckedException extends Exception { private static final long serialVersionUID = 1L; public CustomCheckedException() { - super(); } - public CustomCheckedException(String message) { + public CustomCheckedException(final String message) { super(message); } - public CustomCheckedException(String message, Throwable cause) { + public CustomCheckedException(final String message, final Throwable cause) { super(message, cause); } - public CustomCheckedException(Throwable cause) { + public CustomCheckedException(final Throwable cause) { super(cause); } diff --git a/src/test/java/org/apache/commons/lang3/exception/CustomUncheckedException.java b/src/test/java/org/apache/commons/lang3/exception/CustomUncheckedException.java index d0f53674e..f6029f907 100644 --- a/src/test/java/org/apache/commons/lang3/exception/CustomUncheckedException.java +++ b/src/test/java/org/apache/commons/lang3/exception/CustomUncheckedException.java @@ -22,18 +22,17 @@ public class CustomUncheckedException extends RuntimeException { private static final long serialVersionUID = 1L; public CustomUncheckedException() { - super(); } - public CustomUncheckedException(String message) { + public CustomUncheckedException(final String message) { super(message); } - public CustomUncheckedException(String message, Throwable cause) { + public CustomUncheckedException(final String message, final Throwable cause) { super(message, cause); } - public CustomUncheckedException(Throwable cause) { + public CustomUncheckedException(final Throwable cause) { super(cause); } diff --git a/src/test/java/org/apache/commons/lang3/function/ConsumersTest.java b/src/test/java/org/apache/commons/lang3/function/ConsumersTest.java index f7b124fdd..201297092 100644 --- a/src/test/java/org/apache/commons/lang3/function/ConsumersTest.java +++ b/src/test/java/org/apache/commons/lang3/function/ConsumersTest.java @@ -34,11 +34,11 @@ public class ConsumersTest { public void testNop() { Stream.of("").forEach(Consumers.nop()); // - Consumer<?> c1 = Consumers.nop(); + final Consumer<?> c1 = Consumers.nop(); c1.accept(null); - Consumer<Object> c2 = Consumers.nop(); + final Consumer<Object> c2 = Consumers.nop(); c2.accept(null); - Consumer<String> c3 = Consumers.nop(); + final Consumer<String> c3 = Consumers.nop(); c3.accept(null); // Consumers.nop().accept(null); diff --git a/src/test/java/org/apache/commons/lang3/stream/StreamsTest.java b/src/test/java/org/apache/commons/lang3/stream/StreamsTest.java index 2a7d0b1ce..88fbb7bd7 100644 --- a/src/test/java/org/apache/commons/lang3/stream/StreamsTest.java +++ b/src/test/java/org/apache/commons/lang3/stream/StreamsTest.java @@ -143,7 +143,7 @@ public class StreamsTest { assertEquals(2, Streams.instancesOf(String.class, Arrays.asList(null, "A", null, "B", null)).collect(Collectors.toList()).size()); assertEquals(0, Streams.instancesOf(String.class, Arrays.asList(null, null)).collect(Collectors.toList()).size()); // - List<Object> objects = Arrays.asList("A", "B"); + final List<Object> objects = Arrays.asList("A", "B"); assertEquals(2, Streams.instancesOf(String.class, objects).collect(Collectors.toList()).size()); } diff --git a/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java b/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java index 2719fc0dd..f4797dcc8 100644 --- a/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/time/DateFormatUtilsTest.java @@ -152,8 +152,8 @@ public class DateFormatUtilsTest { @Test public void testLANG1462() { - TimeZone timeZone = TimeZone.getTimeZone("GMT-3"); - Calendar calendar = createJuneTestDate(timeZone); + final TimeZone timeZone = TimeZone.getTimeZone("GMT-3"); + final Calendar calendar = createJuneTestDate(timeZone); assertEquals("20030608101112", DateFormatUtils.format(calendar, "yyyyMMddHHmmss")); calendar.setTimeZone(TimeZone.getTimeZone("JST")); assertEquals("20030608221112", DateFormatUtils.format(calendar, "yyyyMMddHHmmss")); diff --git a/src/test/java/org/apache/commons/lang3/time/DurationUtilsTest.java b/src/test/java/org/apache/commons/lang3/time/DurationUtilsTest.java index 16e4f2d31..10a5ecd24 100644 --- a/src/test/java/org/apache/commons/lang3/time/DurationUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/time/DurationUtilsTest.java @@ -76,7 +76,7 @@ public class DurationUtilsTest { @Test public void testOfRunnble() { - assertTrue(DurationUtils.of(() -> testSince()).compareTo(Duration.ZERO) >= 0); + assertTrue(DurationUtils.of(this::testSince).compareTo(Duration.ZERO) >= 0); } @Test