You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/03/07 20:49:29 UTC

[commons-lang] branch master updated (e3e020f -> 0013a99)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git.


    from e3e020f  Unnecessary @SuppressWarnings("unchecked")
     new 9ebcddc  Use try-with-resources.
     new 22cd660  Remove unused exceptions from test method signatures.
     new faa2445  Use genercis.
     new 1230298  Unnecessary @SuppressWarnings("unchecked")
     new 749062a  Remove unused exceptions from test method signatures.
     new b02dad4  Unnecessary @SuppressWarnings("unchecked")
     new 7752a7b  Remove unused exceptions from test method signatures.
     new b4f25f3  Unnecessary @SuppressWarnings.
     new fb56d81  Use genercis.
     new 0013a99  Fix Checkstyle issue.

The 10 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../commons/lang3/builder/HashCodeBuilderTest.java |  4 -
 .../ReflectionToStringBuilderConcurrencyTest.java  | 10 +--
 .../builder/ToStringStyleConcurrencyTest.java      | 10 +--
 .../lang3/concurrent/ConcurrentUtilsTest.java      | 88 +++++++---------------
 .../lang3/event/EventListenerSupportTest.java      |  7 +-
 .../commons/lang3/reflect/FieldUtilsTest.java      |  2 +-
 .../commons/lang3/time/FastDateParserTest.java     |  2 +-
 .../apache/commons/lang3/time/StopWatchTest.java   |  4 +-
 .../org/apache/commons/lang3/tuple/PairTest.java   |  2 +-
 9 files changed, 42 insertions(+), 87 deletions(-)

[commons-lang] 07/10: Remove unused exceptions from test method signatures.

Posted by gg...@apache.org.
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

commit 7752a7b980b23ab5ad2e2ef4da738428ed168920
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Mar 7 15:37:00 2022 -0500

    Remove unused exceptions from test method signatures.
---
 .../commons/lang3/builder/ToStringStyleConcurrencyTest.java    | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/test/java/org/apache/commons/lang3/builder/ToStringStyleConcurrencyTest.java b/src/test/java/org/apache/commons/lang3/builder/ToStringStyleConcurrencyTest.java
index 379f7f4..8453e0e 100644
--- a/src/test/java/org/apache/commons/lang3/builder/ToStringStyleConcurrencyTest.java
+++ b/src/test/java/org/apache/commons/lang3/builder/ToStringStyleConcurrencyTest.java
@@ -23,7 +23,6 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.concurrent.Callable;
 import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
@@ -68,22 +67,21 @@ public class ToStringStyleConcurrencyTest {
     }
 
     @Test
-    public void testLinkedList() throws InterruptedException, ExecutionException {
+    public void testLinkedList() throws InterruptedException {
         this.testConcurrency(new CollectionHolder<>(new LinkedList<>()));
     }
 
     @Test
-    public void testArrayList() throws InterruptedException, ExecutionException {
+    public void testArrayList() throws InterruptedException {
         this.testConcurrency(new CollectionHolder<>(new ArrayList<>()));
     }
 
     @Test
-    public void testCopyOnWriteArrayList() throws InterruptedException, ExecutionException {
+    public void testCopyOnWriteArrayList() throws InterruptedException {
         this.testConcurrency(new CollectionHolder<>(new CopyOnWriteArrayList<>()));
     }
 
-    private void testConcurrency(final CollectionHolder<List<Integer>> holder) throws InterruptedException,
-        ExecutionException {
+    private void testConcurrency(final CollectionHolder<List<Integer>> holder) throws InterruptedException {
         final List<Integer> list = holder.collection;
         // make a big array that takes a long time to toString()
         list.addAll(LIST);

[commons-lang] 04/10: Unnecessary @SuppressWarnings("unchecked")

Posted by gg...@apache.org.
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

commit 123029804473d1817d8c303075e1733eff756b40
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Mar 7 15:35:51 2022 -0500

    Unnecessary @SuppressWarnings("unchecked")
---
 .../lang3/concurrent/ConcurrentUtilsTest.java      | 88 +++++++---------------
 1 file changed, 26 insertions(+), 62 deletions(-)

diff --git a/src/test/java/org/apache/commons/lang3/concurrent/ConcurrentUtilsTest.java b/src/test/java/org/apache/commons/lang3/concurrent/ConcurrentUtilsTest.java
index 1e20c49..218d61c 100644
--- a/src/test/java/org/apache/commons/lang3/concurrent/ConcurrentUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/concurrent/ConcurrentUtilsTest.java
@@ -107,8 +107,7 @@ public class ConcurrentUtilsTest {
     @Test
     public void testExtractCauseError() {
         final Error err = new AssertionError("Test");
-        final AssertionError e =
-                assertThrows(AssertionError.class, () -> ConcurrentUtils.extractCause(new ExecutionException(err)));
+        final AssertionError e = assertThrows(AssertionError.class, () -> ConcurrentUtils.extractCause(new ExecutionException(err)));
         assertEquals(err, e, "Wrong error");
     }
 
@@ -127,8 +126,7 @@ public class ConcurrentUtilsTest {
     @Test
     public void testExtractCauseChecked() {
         final Exception ex = new Exception("Test");
-        final ConcurrentException cex = ConcurrentUtils
-                .extractCause(new ExecutionException(ex));
+        final ConcurrentException cex = ConcurrentUtils.extractCause(new ExecutionException(ex));
         assertSame(ex, cex.getCause(), "Wrong cause");
     }
 
@@ -164,8 +162,7 @@ public class ConcurrentUtilsTest {
     @Test
     public void testExtractCauseUncheckedUncheckedException() {
         final RuntimeException rex = new RuntimeException("Test");
-        final RuntimeException r =
-                assertThrows(RuntimeException.class, () -> ConcurrentUtils.extractCauseUnchecked(new ExecutionException(rex)));
+        final RuntimeException r = assertThrows(RuntimeException.class, () -> ConcurrentUtils.extractCauseUnchecked(new ExecutionException(rex)));
         assertEquals(rex, r, "Wrong exception");
     }
 
@@ -175,8 +172,7 @@ public class ConcurrentUtilsTest {
     @Test
     public void testExtractCauseUncheckedChecked() {
         final Exception ex = new Exception("Test");
-        final ConcurrentRuntimeException cex = ConcurrentUtils
-                .extractCauseUnchecked(new ExecutionException(ex));
+        final ConcurrentRuntimeException cex = ConcurrentUtils.extractCauseUnchecked(new ExecutionException(ex));
         assertSame(ex, cex.getCause(), "Wrong cause");
     }
 
@@ -196,8 +192,7 @@ public class ConcurrentUtilsTest {
     @Test
     public void testHandleCauseUncheckedException() {
         final RuntimeException rex = new RuntimeException("Test");
-        final RuntimeException r =
-                assertThrows(RuntimeException.class, () -> ConcurrentUtils.handleCause(new ExecutionException(rex)));
+        final RuntimeException r = assertThrows(RuntimeException.class, () -> ConcurrentUtils.handleCause(new ExecutionException(rex)));
         assertEquals(rex, r, "Wrong exception");
     }
 
@@ -207,15 +202,13 @@ public class ConcurrentUtilsTest {
     @Test
     public void testHandleCauseChecked() {
         final Exception ex = new Exception("Test");
-        final ConcurrentException cex =
-                assertThrows(ConcurrentException.class, () -> ConcurrentUtils.handleCause(new ExecutionException(ex)));
+        final ConcurrentException cex = assertThrows(ConcurrentException.class, () -> ConcurrentUtils.handleCause(new ExecutionException(ex)));
         assertEquals(ex, cex.getCause(), "Wrong cause");
     }
 
     /**
-     * Tests handleCause() for a null parameter or a null cause. In this case
-     * the method should do nothing. We can only test that no exception is
-     * thrown.
+     * Tests handleCause() for a null parameter or a null cause. In this case the method should do nothing. We can only test
+     * that no exception is thrown.
      *
      * @throws org.apache.commons.lang3.concurrent.ConcurrentException so we don't have to catch it
      */
@@ -241,8 +234,7 @@ public class ConcurrentUtilsTest {
     @Test
     public void testHandleCauseUncheckedUncheckedException() {
         final RuntimeException rex = new RuntimeException("Test");
-        final RuntimeException r =
-                assertThrows(RuntimeException.class, () -> ConcurrentUtils.handleCauseUnchecked(new ExecutionException(rex)));
+        final RuntimeException r = assertThrows(RuntimeException.class, () -> ConcurrentUtils.handleCauseUnchecked(new ExecutionException(rex)));
         assertEquals(rex, r, "Wrong exception");
     }
 
@@ -252,21 +244,19 @@ public class ConcurrentUtilsTest {
     @Test
     public void testHandleCauseUncheckedChecked() {
         final Exception ex = new Exception("Test");
-        final ConcurrentRuntimeException crex =
-                assertThrows(ConcurrentRuntimeException.class, () -> ConcurrentUtils.handleCauseUnchecked(new ExecutionException(ex)));
+        final ConcurrentRuntimeException crex = assertThrows(ConcurrentRuntimeException.class,
+            () -> ConcurrentUtils.handleCauseUnchecked(new ExecutionException(ex)));
         assertEquals(ex, crex.getCause(), "Wrong cause");
     }
 
     /**
-     * Tests handleCauseUnchecked() for a null parameter or a null cause. In
-     * this case the method should do nothing. We can only test that no
-     * exception is thrown.
+     * Tests handleCauseUnchecked() for a null parameter or a null cause. In this case the method should do nothing. We can
+     * only test that no exception is thrown.
      */
     @Test
     public void testHandleCauseUncheckedNull() {
         ConcurrentUtils.handleCauseUnchecked(null);
-        ConcurrentUtils.handleCauseUnchecked(new ExecutionException("Test",
-                null));
+        ConcurrentUtils.handleCauseUnchecked(new ExecutionException("Test", null));
     }
 
     /**
@@ -286,10 +276,7 @@ public class ConcurrentUtilsTest {
      */
     @Test
     public void testInitialize() throws ConcurrentException {
-        @SuppressWarnings("unchecked")
-        final
-        ConcurrentInitializer<Object> init = EasyMock
-                .createMock(ConcurrentInitializer.class);
+        final ConcurrentInitializer<Object> init = EasyMock.createMock(ConcurrentInitializer.class);
         final Object result = new Object();
         EasyMock.expect(init.get()).andReturn(result);
         EasyMock.replay(init);
@@ -320,10 +307,7 @@ public class ConcurrentUtilsTest {
      */
     @Test
     public void testInitializeUnchecked() throws ConcurrentException {
-        @SuppressWarnings("unchecked")
-        final
-        ConcurrentInitializer<Object> init = EasyMock
-                .createMock(ConcurrentInitializer.class);
+        final ConcurrentInitializer<Object> init = EasyMock.createMock(ConcurrentInitializer.class);
         final Object result = new Object();
         EasyMock.expect(init.get()).andReturn(result);
         EasyMock.replay(init);
@@ -338,15 +322,11 @@ public class ConcurrentUtilsTest {
      */
     @Test
     public void testInitializeUncheckedEx() throws ConcurrentException {
-        @SuppressWarnings("unchecked")
-        final
-        ConcurrentInitializer<Object> init = EasyMock
-                .createMock(ConcurrentInitializer.class);
+        final ConcurrentInitializer<Object> init = EasyMock.createMock(ConcurrentInitializer.class);
         final Exception cause = new Exception();
         EasyMock.expect(init.get()).andThrow(new ConcurrentException(cause));
         EasyMock.replay(init);
-        final ConcurrentRuntimeException crex =
-                assertThrows(ConcurrentRuntimeException.class, () -> ConcurrentUtils.initializeUnchecked(init));
+        final ConcurrentRuntimeException crex = assertThrows(ConcurrentRuntimeException.class, () -> ConcurrentUtils.initializeUnchecked(init));
         assertSame(cause, crex.getCause(), "Wrong cause");
         EasyMock.verify(init);
     }
@@ -427,10 +407,7 @@ public class ConcurrentUtilsTest {
      */
     @Test
     public void testCreateIfAbsentKeyPresent() throws ConcurrentException {
-        @SuppressWarnings("unchecked")
-        final
-        ConcurrentInitializer<Integer> init = EasyMock
-                .createMock(ConcurrentInitializer.class);
+        final ConcurrentInitializer<Integer> init = EasyMock.createMock(ConcurrentInitializer.class);
         EasyMock.replay(init);
         final String key = "testKey";
         final Integer value = 42;
@@ -448,10 +425,7 @@ public class ConcurrentUtilsTest {
      */
     @Test
     public void testCreateIfAbsentKeyNotPresent() throws ConcurrentException {
-        @SuppressWarnings("unchecked")
-        final
-        ConcurrentInitializer<Integer> init = EasyMock
-                .createMock(ConcurrentInitializer.class);
+        final ConcurrentInitializer<Integer> init = EasyMock.createMock(ConcurrentInitializer.class);
         final String key = "testKey";
         final Integer value = 42;
         EasyMock.expect(init.get()).andReturn(value);
@@ -469,10 +443,7 @@ public class ConcurrentUtilsTest {
      */
     @Test
     public void testCreateIfAbsentNullMap() throws ConcurrentException {
-        @SuppressWarnings("unchecked")
-        final
-        ConcurrentInitializer<Integer> init = EasyMock
-                .createMock(ConcurrentInitializer.class);
+        final ConcurrentInitializer<Integer> init = EasyMock.createMock(ConcurrentInitializer.class);
         EasyMock.replay(init);
         assertNull(ConcurrentUtils.createIfAbsent(null, "test", init), "Wrong result");
         EasyMock.verify(init);
@@ -501,8 +472,7 @@ public class ConcurrentUtilsTest {
         final String key = "testKey";
         final Integer value = 42;
         final ConcurrentMap<String, Integer> map = new ConcurrentHashMap<>();
-        assertEquals(value, ConcurrentUtils.createIfAbsentUnchecked(map, key, new ConstantInitializer<>(value)),
-                "Wrong result");
+        assertEquals(value, ConcurrentUtils.createIfAbsentUnchecked(map, key, new ConstantInitializer<>(value)), "Wrong result");
         assertEquals(value, map.get(key), "Wrong value in map");
     }
 
@@ -512,19 +482,13 @@ public class ConcurrentUtilsTest {
      * @throws org.apache.commons.lang3.concurrent.ConcurrentException so we don't have to catch it
      */
     @Test
-    public void testCreateIfAbsentUncheckedException()
-            throws ConcurrentException {
-        @SuppressWarnings("unchecked")
-        final
-        ConcurrentInitializer<Integer> init = EasyMock
-                .createMock(ConcurrentInitializer.class);
+    public void testCreateIfAbsentUncheckedException() throws ConcurrentException {
+        final ConcurrentInitializer<Integer> init = EasyMock.createMock(ConcurrentInitializer.class);
         final Exception ex = new Exception();
         EasyMock.expect(init.get()).andThrow(new ConcurrentException(ex));
         EasyMock.replay(init);
-        final ConcurrentRuntimeException crex =
-                assertThrows(
-                        ConcurrentRuntimeException.class,
-                        () -> ConcurrentUtils.createIfAbsentUnchecked(new ConcurrentHashMap<>(), "test", init));
+        final ConcurrentRuntimeException crex = assertThrows(ConcurrentRuntimeException.class,
+            () -> ConcurrentUtils.createIfAbsentUnchecked(new ConcurrentHashMap<>(), "test", init));
         assertEquals(ex, crex.getCause(), "Wrong cause");
         EasyMock.verify(init);
     }

[commons-lang] 06/10: Unnecessary @SuppressWarnings("unchecked")

Posted by gg...@apache.org.
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

commit b02dad440f14b56250c60bfcee96cb6f94469be8
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Mar 7 15:36:13 2022 -0500

    Unnecessary @SuppressWarnings("unchecked")
---
 src/test/java/org/apache/commons/lang3/time/StopWatchTest.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/test/java/org/apache/commons/lang3/time/StopWatchTest.java b/src/test/java/org/apache/commons/lang3/time/StopWatchTest.java
index b59ee8c..60e3e65 100644
--- a/src/test/java/org/apache/commons/lang3/time/StopWatchTest.java
+++ b/src/test/java/org/apache/commons/lang3/time/StopWatchTest.java
@@ -141,7 +141,7 @@ public class StopWatchTest {
     }
 
     @Test
-    public void testFormatSplitTime() throws InterruptedException {
+    public void testFormatSplitTime() {
         final StopWatch watch = StopWatch.createStarted();
         ThreadUtils.sleepQuietly(MIN_SLEEP_MILLISECONDS);
         watch.split();
@@ -151,7 +151,7 @@ public class StopWatchTest {
     }
 
     @Test
-    public void testFormatSplitTimeWithMessage() throws InterruptedException {
+    public void testFormatSplitTimeWithMessage() {
         final StopWatch watch = new StopWatch(MESSAGE);
         watch.start();
         ThreadUtils.sleepQuietly(MIN_SLEEP_MILLISECONDS);

[commons-lang] 08/10: Unnecessary @SuppressWarnings.

Posted by gg...@apache.org.
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

commit b4f25f30561a9222a1de76133c1e9452badbb3fe
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Mar 7 15:38:02 2022 -0500

    Unnecessary @SuppressWarnings.
---
 .../java/org/apache/commons/lang3/builder/HashCodeBuilderTest.java    | 4 ----
 1 file changed, 4 deletions(-)

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 d43ea02..a9c839c 100644
--- a/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderTest.java
+++ b/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderTest.java
@@ -207,7 +207,6 @@ public class HashCodeBuilderTest {
     }
 
     @Test
-    @SuppressWarnings("cast") // cast is not really needed, keep for consistency
     public void testLong() {
         assertEquals(17 * 37, new HashCodeBuilder(17, 37).append(0L).toHashCode());
         assertEquals(17 * 37 + (int) (123456789L ^ 123456789L >> 32), new HashCodeBuilder(17, 37).append(
@@ -215,7 +214,6 @@ public class HashCodeBuilderTest {
     }
 
     @Test
-    @SuppressWarnings("cast") // cast is not really needed, keep for consistency
     public void testInt() {
         assertEquals(17 * 37, new HashCodeBuilder(17, 37).append(0).toHashCode());
         assertEquals(17 * 37 + 123456, new HashCodeBuilder(17, 37).append(123456).toHashCode());
@@ -240,7 +238,6 @@ public class HashCodeBuilderTest {
     }
 
     @Test
-    @SuppressWarnings("cast") // cast is not really needed, keep for consistency
     public void testDouble() {
         assertEquals(17 * 37, new HashCodeBuilder(17, 37).append(0d).toHashCode());
         final double d = 1234567.89;
@@ -249,7 +246,6 @@ public class HashCodeBuilderTest {
     }
 
     @Test
-    @SuppressWarnings("cast") // cast is not really needed, keep for consistency
     public void testFloat() {
         assertEquals(17 * 37, new HashCodeBuilder(17, 37).append(0f).toHashCode());
         final float f = 1234.89f;

[commons-lang] 01/10: Use try-with-resources.

Posted by gg...@apache.org.
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

commit 9ebcddc0b15c39f18c26b330acd3bfd921ef9bff
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Mar 7 15:27:28 2022 -0500

    Use try-with-resources.
---
 .../org/apache/commons/lang3/event/EventListenerSupportTest.java   | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java b/src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java
index facff22..9371339 100644
--- a/src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java
+++ b/src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java
@@ -142,10 +142,9 @@ public class EventListenerSupportTest {
 
         //serialize:
         final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-        final ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream);
-
-        objectOutputStream.writeObject(listenerSupport);
-        objectOutputStream.close();
+        try (final ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream)) {
+            objectOutputStream.writeObject(listenerSupport);
+        }
 
         //deserialize:
         @SuppressWarnings("unchecked")

[commons-lang] 10/10: Fix Checkstyle issue.

Posted by gg...@apache.org.
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

commit 0013a996d219e8113d91ea09a8518c1a1e4c00cd
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Mar 7 15:49:24 2022 -0500

    Fix Checkstyle issue.
---
 .../java/org/apache/commons/lang3/event/EventListenerSupportTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java b/src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java
index 9371339..09080fe 100644
--- a/src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java
+++ b/src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java
@@ -142,7 +142,7 @@ public class EventListenerSupportTest {
 
         //serialize:
         final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-        try (final ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream)) {
+        try (ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream)) {
             objectOutputStream.writeObject(listenerSupport);
         }
 

[commons-lang] 09/10: Use genercis.

Posted by gg...@apache.org.
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

commit fb56d81ec228149eb88a4c426b56b2b17dc09390
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Mar 7 15:38:34 2022 -0500

    Use genercis.
---
 src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java b/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java
index 662f711..2c5b8e5 100644
--- a/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java
@@ -195,7 +195,7 @@ public class FieldUtilsTest {
         final List<Field> fieldsInteger = Arrays.asList(Integer.class.getDeclaredFields());
         final List<Field> allFieldsInteger = new ArrayList<>(fieldsInteger);
         allFieldsInteger.addAll(fieldsNumber);
-        assertEquals(new HashSet(allFieldsInteger), new HashSet(FieldUtils.getAllFieldsList(Integer.class)));
+        assertEquals(new HashSet<>(allFieldsInteger), new HashSet<>(FieldUtils.getAllFieldsList(Integer.class)));
         final List<Field> allFields = FieldUtils.getAllFieldsList(PublicChild.class);
         // Under Jacoco,0.8.1 and Java 10, the field count is 7.
         int expected = 5;

[commons-lang] 02/10: Remove unused exceptions from test method signatures.

Posted by gg...@apache.org.
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

commit 22cd660c33c8f98c2e634bcd2a8e2b89dda0f020
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Mar 7 15:28:11 2022 -0500

    Remove unused exceptions from test method signatures.
---
 .../builder/ReflectionToStringBuilderConcurrencyTest.java      | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderConcurrencyTest.java b/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderConcurrencyTest.java
index 668102a..ba02486 100644
--- a/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderConcurrencyTest.java
+++ b/src/test/java/org/apache/commons/lang3/builder/ReflectionToStringBuilderConcurrencyTest.java
@@ -26,7 +26,6 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.concurrent.Callable;
 import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
@@ -65,24 +64,23 @@ public class ReflectionToStringBuilderConcurrencyTest {
 
     @Test
     @Disabled
-    public void testLinkedList() throws InterruptedException, ExecutionException {
+    public void testLinkedList() throws InterruptedException {
         this.testConcurrency(new CollectionHolder<>(new LinkedList<>()));
     }
 
     @Test
     @Disabled
-    public void testArrayList() throws InterruptedException, ExecutionException {
+    public void testArrayList() throws InterruptedException {
         this.testConcurrency(new CollectionHolder<>(new ArrayList<>()));
     }
 
     @Test
     @Disabled
-    public void testCopyOnWriteArrayList() throws InterruptedException, ExecutionException {
+    public void testCopyOnWriteArrayList() throws InterruptedException {
         this.testConcurrency(new CollectionHolder<>(new CopyOnWriteArrayList<>()));
     }
 
-    private void testConcurrency(final CollectionHolder<List<Integer>> holder) throws InterruptedException,
-        ExecutionException {
+    private void testConcurrency(final CollectionHolder<List<Integer>> holder) throws InterruptedException {
         final List<Integer> list = holder.collection;
         // make a big array that takes a long time to toString()
         for (int i = 0; i < DATA_SIZE; i++) {

[commons-lang] 03/10: Use genercis.

Posted by gg...@apache.org.
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

commit faa24452b5b0947ba0f8af454d8eb77fbd6e50d6
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Mar 7 15:32:16 2022 -0500

    Use genercis.
---
 src/test/java/org/apache/commons/lang3/tuple/PairTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/java/org/apache/commons/lang3/tuple/PairTest.java b/src/test/java/org/apache/commons/lang3/tuple/PairTest.java
index 4640a9c..6ede8f9 100644
--- a/src/test/java/org/apache/commons/lang3/tuple/PairTest.java
+++ b/src/test/java/org/apache/commons/lang3/tuple/PairTest.java
@@ -134,7 +134,7 @@ public class PairTest {
         assertTrue(pair2 instanceof ImmutablePair<?, ?>);
         assertNull(((ImmutablePair<Object, String>) pair2).left);
         assertEquals("bar", ((ImmutablePair<Object, String>) pair2).right);
-        final Pair pair3 = Pair.of(null, null);
+        final Pair<?, ?> pair3 = Pair.of(null, null);
         assertNull(pair3.getLeft());
         assertNull(pair3.getRight());
     }

[commons-lang] 05/10: Remove unused exceptions from test method signatures.

Posted by gg...@apache.org.
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

commit 749062a6c0920ff5aed91842e9f7dcfd3c6b2f9c
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Mar 7 15:36:03 2022 -0500

    Remove unused exceptions from test method signatures.
---
 src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java b/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
index e548d2c..409521c 100644
--- a/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
+++ b/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
@@ -317,7 +317,7 @@ public class FastDateParserTest {
     }
 
     @Test
-    public void testJpLocales() throws ParseException {
+    public void testJpLocales() {
 
         final Calendar cal = Calendar.getInstance(TimeZones.GMT);
         cal.clear();