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 2024/05/22 12:57:45 UTC

(commons-collections) 01/16: Fix PMD UnnecessaryFullyQualifiedName in CollectionUtils

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-collections.git

commit 91bc42e7f4524ef63a1d4d1e1f4769c286ee392e
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed May 22 08:32:31 2024 -0400

    Fix PMD UnnecessaryFullyQualifiedName in CollectionUtils
---
 src/changes/changes.xml                                        |  1 +
 .../java/org/apache/commons/collections4/CollectionUtils.java  | 10 +++++-----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 5327a4201..b760ab81a 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -32,6 +32,7 @@
      <action type="update" dev="ggregory" due-to="Gary Gregory">Deprecate Predicate in favor of java.util.function.Predicate.</action>
      <action type="update" dev="ggregory" due-to="Gary Gregory">Deprecate Transformer in favor of java.util.function.Function.</action>
      <action issue="COLLECTIONS-853" type="fix" dev="aherbert" due-to="Claude Warren, Alex Herbert, Gary Gregory">Change LayerManager to use List and added generics to LayerdedBloomFilter #481.</action>
+     <action type="update" dev="ggregory" due-to="PMD, Gary Gregory">Fix PMD UnnecessaryFullyQualifiedName in CollectionUtils.</action>
      <!-- UPDATE -->
      <action type="update" dev="ggregory" due-to="Dependabot">Bump org.apache.commons:commons-parent from 67 to 69 #473.</action>
      <action type="update" dev="ggregory" due-to="Dependabot">Bump tests commons-io:commons-io from 2.16.0 to 2.16.1 #475.</action>
diff --git a/src/main/java/org/apache/commons/collections4/CollectionUtils.java b/src/main/java/org/apache/commons/collections4/CollectionUtils.java
index 5283c1735..0d95aacff 100644
--- a/src/main/java/org/apache/commons/collections4/CollectionUtils.java
+++ b/src/main/java/org/apache/commons/collections4/CollectionUtils.java
@@ -74,8 +74,8 @@ public class CollectionUtils {
          * @param b  the second collection
          */
         CardinalityHelper(final Iterable<? extends O> a, final Iterable<? extends O> b) {
-            cardinalityA = CollectionUtils.<O>getCardinalityMap(a);
-            cardinalityB = CollectionUtils.<O>getCardinalityMap(b);
+            cardinalityA = getCardinalityMap(a);
+            cardinalityB = getCardinalityMap(b);
         }
 
         /**
@@ -778,7 +778,7 @@ public class CollectionUtils {
      * @return an empty collection if the argument is {@code null}
      */
     public static <T> Collection<T> emptyIfNull(final Collection<T> collection) {
-        return collection == null ? CollectionUtils.<T>emptyCollection() : collection;
+        return collection == null ? emptyCollection() : collection;
     }
 
     /**
@@ -1328,7 +1328,7 @@ public class CollectionUtils {
     public static boolean isProperSubCollection(final Collection<?> a, final Collection<?> b) {
         Objects.requireNonNull(a, "a");
         Objects.requireNonNull(b, "b");
-        return a.size() < b.size() && CollectionUtils.isSubCollection(a, b);
+        return a.size() < b.size() && isSubCollection(a, b);
     }
 
     /**
@@ -1599,7 +1599,7 @@ public class CollectionUtils {
         if (input.size() < endIndex) {
             throw new IndexOutOfBoundsException("The end index can't be greater than the size of collection.");
         }
-        return CollectionUtils.removeCount(input, startIndex, endIndex - startIndex);
+        return removeCount(input, startIndex, endIndex - startIndex);
     }
 
     /**