diff --git a/src/main/java/org/apache/commons/collections4/list/AbstractLinkedList.java b/src/main/java/org/apache/commons/collections4/list/AbstractLinkedList.java index b6b4a99ee1..e9411019d6 100644 --- a/src/main/java/org/apache/commons/collections4/list/AbstractLinkedList.java +++ b/src/main/java/org/apache/commons/collections4/list/AbstractLinkedList.java @@ -43,7 +43,7 @@ * * @param the type of elements in this list * @since 3.0 - * @deprecated use {@link AbstractLinkedListForJava21} instead + * @deprecated use {@link AbstractLinkedListJava21} instead */ @Deprecated public abstract class AbstractLinkedList implements List { diff --git a/src/main/java/org/apache/commons/collections4/list/AbstractLinkedListForJava21.java b/src/main/java/org/apache/commons/collections4/list/AbstractLinkedListJava21.java similarity index 97% rename from src/main/java/org/apache/commons/collections4/list/AbstractLinkedListForJava21.java rename to src/main/java/org/apache/commons/collections4/list/AbstractLinkedListJava21.java index 7a74f892b1..77d5e5669b 100644 --- a/src/main/java/org/apache/commons/collections4/list/AbstractLinkedListForJava21.java +++ b/src/main/java/org/apache/commons/collections4/list/AbstractLinkedListJava21.java @@ -44,9 +44,9 @@ * (see COLLECTIONS-842 for details). * * @param the type of elements in this list - * @since 4.5.0-M2 + * @since 4.5.0-M3 */ -public abstract class AbstractLinkedListForJava21 implements List { +public abstract class AbstractLinkedListJava21 implements List { /* * Implementation notes: @@ -67,11 +67,11 @@ public abstract class AbstractLinkedListForJava21 implements List { protected static class LinkedListIterator implements ListIterator, OrderedIterator { /** The parent list */ - protected final AbstractLinkedListForJava21 parent; + protected final AbstractLinkedListJava21 parent; /** * The node that will be returned by {@link #next()}. If this is equal - * to {@link AbstractLinkedListForJava21#header} then there are no more values to return. + * to {@link AbstractLinkedListJava21#header} then there are no more values to return. */ protected Node next; @@ -105,7 +105,7 @@ protected static class LinkedListIterator implements ListIterator, Ordered * @param fromIndex the index to start at * @throws IndexOutOfBoundsException if fromIndex is less than 0 or greater than the size of the list */ - protected LinkedListIterator(final AbstractLinkedListForJava21 parent, final int fromIndex) + protected LinkedListIterator(final AbstractLinkedListJava21 parent, final int fromIndex) throws IndexOutOfBoundsException { this.parent = parent; this.expectedModCount = parent.modCount; @@ -221,13 +221,13 @@ public void set(final E obj) { } /** - * The sublist implementation for AbstractLinkedListForJava21. + * The sublist implementation for AbstractLinkedListJava21. * * @param the type of elements in this list. */ protected static class LinkedSubList extends AbstractList { /** The main list */ - AbstractLinkedListForJava21 parent; + AbstractLinkedListJava21 parent; /** Offset from the main list */ int offset; /** Sublist size */ @@ -235,7 +235,7 @@ protected static class LinkedSubList extends AbstractList { /** Sublist modCount */ int expectedModCount; - protected LinkedSubList(final AbstractLinkedListForJava21 parent, final int fromIndex, final int toIndex) { + protected LinkedSubList(final AbstractLinkedListJava21 parent, final int fromIndex, final int toIndex) { if (fromIndex < 0) { throw new IndexOutOfBoundsException("fromIndex = " + fromIndex); } @@ -527,7 +527,7 @@ protected void setValue(final E value) { * If this constructor is used by a serializable subclass then the init() * method must be called. */ - protected AbstractLinkedListForJava21() { + protected AbstractLinkedListJava21() { } /** @@ -535,7 +535,7 @@ protected AbstractLinkedListForJava21() { * * @param coll the collection to copy */ - protected AbstractLinkedListForJava21(final Collection coll) { + protected AbstractLinkedListJava21(final Collection coll) { init(); addAll(coll); } @@ -597,7 +597,7 @@ protected void addNode(final Node nodeToInsert, final Node insertBeforeNod * {@code value} and inserts it after {@code node}. *

* This implementation uses {@link #createNode(Object)} and - * {@link #addNode(AbstractLinkedListForJava21.Node,AbstractLinkedListForJava21.Node)}. + * {@link #addNode(AbstractLinkedListJava21.Node,AbstractLinkedListJava21.Node)}. * * @param node node to insert after * @param value value of the newly added node @@ -613,7 +613,7 @@ protected void addNodeAfter(final Node node, final E value) { * {@code value} and inserts it before {@code node}. *

* This implementation uses {@link #createNode(Object)} and - * {@link #addNode(AbstractLinkedListForJava21.Node,AbstractLinkedListForJava21.Node)}. + * {@link #addNode(AbstractLinkedListJava21.Node,AbstractLinkedListJava21.Node)}. * * @param node node to insert before * @param value value of the newly added node diff --git a/src/test/java/org/apache/commons/collections4/list/DefaultAbstractLinkedListForJava21Test.java b/src/test/java/org/apache/commons/collections4/list/DefaultAbstractLinkedListJava21Test.java similarity index 91% rename from src/test/java/org/apache/commons/collections4/list/DefaultAbstractLinkedListForJava21Test.java rename to src/test/java/org/apache/commons/collections4/list/DefaultAbstractLinkedListJava21Test.java index dc2d10bbf1..4ffdcd6db3 100644 --- a/src/test/java/org/apache/commons/collections4/list/DefaultAbstractLinkedListForJava21Test.java +++ b/src/test/java/org/apache/commons/collections4/list/DefaultAbstractLinkedListJava21Test.java @@ -28,12 +28,12 @@ import org.junit.jupiter.api.Test; /** - * Test case for {@link AbstractLinkedListForJava21}. + * Test case for {@link AbstractLinkedListJava21}. */ -public class DefaultAbstractLinkedListForJava21Test extends AbstractListTest { +public class DefaultAbstractLinkedListJava21Test extends AbstractListTest { - private static class DefaultAbstractLinkedListForJava21 extends AbstractLinkedListForJava21 { - DefaultAbstractLinkedListForJava21() { + private static class DefaultAbstractLinkedListJava21 extends AbstractLinkedListJava21 { + DefaultAbstractLinkedListJava21() { init(); } @@ -61,12 +61,12 @@ private void writeObject(final ObjectOutputStream out) throws IOException { } } - public DefaultAbstractLinkedListForJava21Test() { - super(DefaultAbstractLinkedListForJava21Test.class.getSimpleName()); + public DefaultAbstractLinkedListJava21Test() { + super(DefaultAbstractLinkedListJava21Test.class.getSimpleName()); } protected void checkNodes() { - final AbstractLinkedListForJava21 list = getCollection(); + final AbstractLinkedListJava21 list = getCollection(); for (int i = 0; i < list.size; i++) { assertEquals(list.getNode(i, false).next, list.getNode(i + 1, true)); if (i < list.size - 1) { @@ -76,8 +76,8 @@ protected void checkNodes() { } @Override - public AbstractLinkedListForJava21 getCollection() { - return (AbstractLinkedListForJava21) super.getCollection(); + public AbstractLinkedListJava21 getCollection() { + return (AbstractLinkedListJava21) super.getCollection(); } @Override @@ -87,7 +87,7 @@ public String getCompatibilityVersion() { @Override public List makeObject() { - return new DefaultAbstractLinkedListForJava21<>(); + return new DefaultAbstractLinkedListJava21<>(); } @Override @@ -99,7 +99,7 @@ protected boolean skipSerializedCanonicalTests() { @SuppressWarnings("unchecked") public void testAddNodeAfter() { resetEmpty(); - final AbstractLinkedListForJava21 list = getCollection(); + final AbstractLinkedListJava21 list = getCollection(); if (!isAddSupported()) { assertThrows(UnsupportedOperationException.class, () -> list.addFirst(null)); } @@ -130,7 +130,7 @@ public void testAddNodeAfter() { @SuppressWarnings("unchecked") public void testGetNode() { resetEmpty(); - final AbstractLinkedListForJava21 list = getCollection(); + final AbstractLinkedListJava21 list = getCollection(); // get marker assertEquals(list.getNode(0, true).previous, list.getNode(0, true).next); assertThrows(IndexOutOfBoundsException.class, () -> list.getNode(0, false), "Expecting IndexOutOfBoundsException."); @@ -149,7 +149,7 @@ public void testGetNode() { @SuppressWarnings("unchecked") public void testRemoveFirst() { resetEmpty(); - final AbstractLinkedListForJava21 list = getCollection(); + final AbstractLinkedListJava21 list = getCollection(); if (!isRemoveSupported()) { assertThrows(UnsupportedOperationException.class, list::removeFirst); } @@ -171,7 +171,7 @@ public void testRemoveFirst() { @SuppressWarnings("unchecked") public void testRemoveLast() { resetEmpty(); - final AbstractLinkedListForJava21 list = getCollection(); + final AbstractLinkedListJava21 list = getCollection(); if (!isRemoveSupported()) { assertThrows(UnsupportedOperationException.class, list::removeLast); } @@ -194,7 +194,7 @@ public void testRemoveNode() { if (!isAddSupported() || !isRemoveSupported()) { return; } - final AbstractLinkedListForJava21 list = getCollection(); + final AbstractLinkedListJava21 list = getCollection(); list.addAll(Arrays.asList((E[]) new String[] { "value1", "value2" })); list.removeNode(list.getNode(0, false));