diff --git a/src/main/java/org/apache/commons/collections4/ArrayUtils.java b/src/main/java/org/apache/commons/collections4/ArrayUtils.java index 8f2871ea6d..61cbb4821d 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 @@ * * @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 ba469ccaad..3420f4ddfe 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 int getCount(final Object object) { /** * 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 0eb3a8adf0..c6e46fe5e1 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 void clear() { } } - class KeyView extends AbstractView { + final class KeyView extends AbstractView { /** * Creates a new TreeBidiMap.KeyView. @@ -1523,7 +1523,7 @@ public boolean remove(final Object o) { } - class ValueView extends AbstractView { + final class ValueView extends AbstractView { /** * Creates a new TreeBidiMap.ValueView. @@ -1553,7 +1553,7 @@ public boolean remove(final Object o) { /** * A view of this map. */ - class EntryView extends AbstractView> { + final class EntryView extends AbstractView> { EntryView() { super(KEY); @@ -1594,7 +1594,7 @@ public Iterator> iterator() { /** * A view of this map. */ - class InverseEntryView extends AbstractView> { + final class InverseEntryView extends AbstractView> { InverseEntryView() { super(VALUE); @@ -1718,7 +1718,7 @@ public final void remove() { /** * An iterator over the map. */ - class ViewMapIterator extends AbstractViewIterator implements OrderedMapIterator { + final class ViewMapIterator extends AbstractViewIterator implements OrderedMapIterator { /** * Constructor. @@ -1764,7 +1764,7 @@ public K previous() { /** * 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 V previous() { /** * 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 Map.Entry previous() { /** * 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 int hashCode() { /** * 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 0b1998dbe9..251edfa6cb 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 @@ * * @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 10f101d5f1..215e1ddcd9 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 void clear() { AbstractMultiValuedMap.this.clear(); } - class AsMapEntrySet extends AbstractSet>> { + final class AsMapEntrySet extends AbstractSet>> { @Override public Iterator>> iterator() { @@ -864,7 +864,7 @@ public boolean remove(final Object o) { /** * EntrySet iterator for the asMap view. */ - class AsMapEntrySetIterator extends AbstractIteratorDecorator>> { + 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 3da6f6d720..ee22daf49f 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 @@ */ 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 57955ec51b..04418ea4a3 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 @@ * 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 ff790a15be..4c531f4653 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 @@ * 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;