From 07967afd4bbdb3f7bb8b3c584aba26ab6afd0b8a Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Sun, 5 Nov 2023 08:13:52 -0500 Subject: [PATCH] Make package private class final --- .../commons/collections4/ArrayUtils.java | 2 +- .../collections4/bag/SynchronizedBag.java | 2 +- .../collections4/bidimap/TreeBidiMap.java | 18 +++++++++--------- .../collections4/functors/FunctorUtils.java | 2 +- .../multimap/AbstractMultiValuedMap.java | 4 ++-- .../collections4/list/SetUniqueListTest.java | 2 +- .../collections4/map/EmptyMapMutator.java | 2 +- .../collections4/set/EmptySetMutator.java | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main/java/org/apache/commons/collections4/ArrayUtils.java b/src/main/java/org/apache/commons/collections4/ArrayUtils.java index 8f2871ea6..61cbb4821 100644 --- a/src/main/java/org/apache/commons/collections4/ArrayUtils.java +++ b/src/main/java/org/apache/commons/collections4/ArrayUtils.java @@ -35,7 +35,7 @@ package org.apache.commons.collections4; * * @since 4.2 (Copied from Apache Commons Lang.) */ -class ArrayUtils { +final class ArrayUtils { /** diff --git a/src/main/java/org/apache/commons/collections4/bag/SynchronizedBag.java b/src/main/java/org/apache/commons/collections4/bag/SynchronizedBag.java index ba469ccaa..3420f4ddf 100644 --- a/src/main/java/org/apache/commons/collections4/bag/SynchronizedBag.java +++ b/src/main/java/org/apache/commons/collections4/bag/SynchronizedBag.java @@ -133,7 +133,7 @@ public class SynchronizedBag extends SynchronizedCollection implements Bag /** * Synchronized Set for the Bag class. */ - class SynchronizedBagSet extends SynchronizedCollection implements Set { + final class SynchronizedBagSet extends SynchronizedCollection implements Set { /** Serialization version */ private static final long serialVersionUID = 2990565892366827855L; diff --git a/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java b/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java index 0eb3a8adf..c6e46fe5e 100644 --- a/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java +++ b/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java @@ -1496,7 +1496,7 @@ public class TreeBidiMap, V extends Comparable> } } - class KeyView extends AbstractView { + final class KeyView extends AbstractView { /** * Creates a new TreeBidiMap.KeyView. @@ -1523,7 +1523,7 @@ public class TreeBidiMap, V extends Comparable> } - class ValueView extends AbstractView { + final class ValueView extends AbstractView { /** * Creates a new TreeBidiMap.ValueView. @@ -1553,7 +1553,7 @@ public class TreeBidiMap, V extends Comparable> /** * A view of this map. */ - class EntryView extends AbstractView> { + final class EntryView extends AbstractView> { EntryView() { super(KEY); @@ -1594,7 +1594,7 @@ public class TreeBidiMap, V extends Comparable> /** * A view of this map. */ - class InverseEntryView extends AbstractView> { + final class InverseEntryView extends AbstractView> { InverseEntryView() { super(VALUE); @@ -1718,7 +1718,7 @@ public class TreeBidiMap, V extends Comparable> /** * An iterator over the map. */ - class ViewMapIterator extends AbstractViewIterator implements OrderedMapIterator { + final class ViewMapIterator extends AbstractViewIterator implements OrderedMapIterator { /** * Constructor. @@ -1764,7 +1764,7 @@ public class TreeBidiMap, V extends Comparable> /** * An iterator over the map. */ - class InverseViewMapIterator extends AbstractViewIterator implements OrderedMapIterator { + final class InverseViewMapIterator extends AbstractViewIterator implements OrderedMapIterator { /** * Creates a new TreeBidiMap.InverseViewMapIterator. @@ -1810,7 +1810,7 @@ public class TreeBidiMap, V extends Comparable> /** * An iterator over the map entries. */ - class ViewMapEntryIterator extends AbstractViewIterator implements OrderedIterator> { + final class ViewMapEntryIterator extends AbstractViewIterator implements OrderedIterator> { /** * Constructor. @@ -1833,7 +1833,7 @@ public class TreeBidiMap, V extends Comparable> /** * An iterator over the inverse map entries. */ - class InverseViewMapEntryIterator extends AbstractViewIterator implements OrderedIterator> { + final class InverseViewMapEntryIterator extends AbstractViewIterator implements OrderedIterator> { /** * Constructor. @@ -2083,7 +2083,7 @@ public class TreeBidiMap, V extends Comparable> /** * The inverse map implementation. */ - class Inverse implements OrderedBidiMap { + final class Inverse implements OrderedBidiMap { /** Store the keySet once created. */ private Set inverseKeySet; diff --git a/src/main/java/org/apache/commons/collections4/functors/FunctorUtils.java b/src/main/java/org/apache/commons/collections4/functors/FunctorUtils.java index 0b1998dbe..251edfa6c 100644 --- a/src/main/java/org/apache/commons/collections4/functors/FunctorUtils.java +++ b/src/main/java/org/apache/commons/collections4/functors/FunctorUtils.java @@ -28,7 +28,7 @@ import org.apache.commons.collections4.Transformer; * * @since 3.0 */ -class FunctorUtils { +final class FunctorUtils { /** * Restricted constructor. diff --git a/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java b/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java index 10f101d5f..215e1ddcd 100644 --- a/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java +++ b/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java @@ -828,7 +828,7 @@ public abstract class AbstractMultiValuedMap implements MultiValuedMap>> { + final class AsMapEntrySet extends AbstractSet>> { @Override public Iterator>> iterator() { @@ -864,7 +864,7 @@ public abstract class AbstractMultiValuedMap implements MultiValuedMap>> { + final class AsMapEntrySetIterator extends AbstractIteratorDecorator>> { AsMapEntrySetIterator(final Iterator>> iterator) { super(iterator); diff --git a/src/test/java/org/apache/commons/collections4/list/SetUniqueListTest.java b/src/test/java/org/apache/commons/collections4/list/SetUniqueListTest.java index 3da6f6d72..ee22daf49 100644 --- a/src/test/java/org/apache/commons/collections4/list/SetUniqueListTest.java +++ b/src/test/java/org/apache/commons/collections4/list/SetUniqueListTest.java @@ -42,7 +42,7 @@ import org.junit.jupiter.api.Test; */ public class SetUniqueListTest extends AbstractListTest { - class SetUniqueList307 extends SetUniqueList { + final class SetUniqueList307 extends SetUniqueList { /** * Generated serial version ID. */ diff --git a/src/test/java/org/apache/commons/collections4/map/EmptyMapMutator.java b/src/test/java/org/apache/commons/collections4/map/EmptyMapMutator.java index 57955ec51..04418ea4a 100644 --- a/src/test/java/org/apache/commons/collections4/map/EmptyMapMutator.java +++ b/src/test/java/org/apache/commons/collections4/map/EmptyMapMutator.java @@ -24,7 +24,7 @@ import java.util.Map; * the class has to be separate of TestCompositeMap, else the test * class also has to be serialized. */ -class EmptyMapMutator implements CompositeMap.MapMutator { +final class EmptyMapMutator implements CompositeMap.MapMutator { /** Serialization version */ private static final long serialVersionUID = -2729718980002476794L; diff --git a/src/test/java/org/apache/commons/collections4/set/EmptySetMutator.java b/src/test/java/org/apache/commons/collections4/set/EmptySetMutator.java index ff790a15b..4c531f465 100644 --- a/src/test/java/org/apache/commons/collections4/set/EmptySetMutator.java +++ b/src/test/java/org/apache/commons/collections4/set/EmptySetMutator.java @@ -25,7 +25,7 @@ import java.util.Set; * the class has to be separate of CompositeSetTest, else the test * class also has to be serialized. */ -class EmptySetMutator implements CompositeSet.SetMutator { +final class EmptySetMutator implements CompositeSet.SetMutator { /** Serialization version */ private static final long serialVersionUID = 5321193666420238910L;