Slightly less bad new class name

This commit is contained in:
Gary Gregory 2024-10-21 10:24:51 -04:00
parent c7fc724f23
commit a910ebd82f
3 changed files with 28 additions and 28 deletions

View File

@ -43,7 +43,7 @@ import org.apache.commons.collections4.OrderedIterator;
*
* @param <E> 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<E> implements List<E> {

View File

@ -44,9 +44,9 @@ import org.apache.commons.collections4.OrderedIterator;
* (see COLLECTIONS-842 for details).
*
* @param <E> the type of elements in this list
* @since 4.5.0-M2
* @since 4.5.0-M3
*/
public abstract class AbstractLinkedListForJava21<E> implements List<E> {
public abstract class AbstractLinkedListJava21<E> implements List<E> {
/*
* Implementation notes:
@ -67,11 +67,11 @@ public abstract class AbstractLinkedListForJava21<E> implements List<E> {
protected static class LinkedListIterator<E> implements ListIterator<E>, OrderedIterator<E> {
/** The parent list */
protected final AbstractLinkedListForJava21<E> parent;
protected final AbstractLinkedListJava21<E> 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<E> next;
@ -105,7 +105,7 @@ public abstract class AbstractLinkedListForJava21<E> implements List<E> {
* @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<E> parent, final int fromIndex)
protected LinkedListIterator(final AbstractLinkedListJava21<E> parent, final int fromIndex)
throws IndexOutOfBoundsException {
this.parent = parent;
this.expectedModCount = parent.modCount;
@ -221,13 +221,13 @@ public abstract class AbstractLinkedListForJava21<E> implements List<E> {
}
/**
* The sublist implementation for AbstractLinkedListForJava21.
* The sublist implementation for AbstractLinkedListJava21.
*
* @param <E> the type of elements in this list.
*/
protected static class LinkedSubList<E> extends AbstractList<E> {
/** The main list */
AbstractLinkedListForJava21<E> parent;
AbstractLinkedListJava21<E> parent;
/** Offset from the main list */
int offset;
/** Sublist size */
@ -235,7 +235,7 @@ public abstract class AbstractLinkedListForJava21<E> implements List<E> {
/** Sublist modCount */
int expectedModCount;
protected LinkedSubList(final AbstractLinkedListForJava21<E> parent, final int fromIndex, final int toIndex) {
protected LinkedSubList(final AbstractLinkedListJava21<E> parent, final int fromIndex, final int toIndex) {
if (fromIndex < 0) {
throw new IndexOutOfBoundsException("fromIndex = " + fromIndex);
}
@ -527,7 +527,7 @@ public abstract class AbstractLinkedListForJava21<E> implements List<E> {
* If this constructor is used by a serializable subclass then the init()
* method must be called.
*/
protected AbstractLinkedListForJava21() {
protected AbstractLinkedListJava21() {
}
/**
@ -535,7 +535,7 @@ public abstract class AbstractLinkedListForJava21<E> implements List<E> {
*
* @param coll the collection to copy
*/
protected AbstractLinkedListForJava21(final Collection<? extends E> coll) {
protected AbstractLinkedListJava21(final Collection<? extends E> coll) {
init();
addAll(coll);
}
@ -597,7 +597,7 @@ public abstract class AbstractLinkedListForJava21<E> implements List<E> {
* {@code value} and inserts it after {@code node}.
* <p>
* 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 @@ public abstract class AbstractLinkedListForJava21<E> implements List<E> {
* {@code value} and inserts it before {@code node}.
* <p>
* 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

View File

@ -28,12 +28,12 @@ import java.util.List;
import org.junit.jupiter.api.Test;
/**
* Test case for {@link AbstractLinkedListForJava21}.
* Test case for {@link AbstractLinkedListJava21}.
*/
public class DefaultAbstractLinkedListForJava21Test<E> extends AbstractListTest<E> {
public class DefaultAbstractLinkedListJava21Test<E> extends AbstractListTest<E> {
private static class DefaultAbstractLinkedListForJava21<E> extends AbstractLinkedListForJava21<E> {
DefaultAbstractLinkedListForJava21() {
private static class DefaultAbstractLinkedListJava21<E> extends AbstractLinkedListJava21<E> {
DefaultAbstractLinkedListJava21() {
init();
}
@ -61,12 +61,12 @@ public class DefaultAbstractLinkedListForJava21Test<E> extends AbstractListTest<
}
}
public DefaultAbstractLinkedListForJava21Test() {
super(DefaultAbstractLinkedListForJava21Test.class.getSimpleName());
public DefaultAbstractLinkedListJava21Test() {
super(DefaultAbstractLinkedListJava21Test.class.getSimpleName());
}
protected void checkNodes() {
final AbstractLinkedListForJava21<E> list = getCollection();
final AbstractLinkedListJava21<E> 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 @@ public class DefaultAbstractLinkedListForJava21Test<E> extends AbstractListTest<
}
@Override
public AbstractLinkedListForJava21<E> getCollection() {
return (AbstractLinkedListForJava21<E>) super.getCollection();
public AbstractLinkedListJava21<E> getCollection() {
return (AbstractLinkedListJava21<E>) super.getCollection();
}
@Override
@ -87,7 +87,7 @@ public class DefaultAbstractLinkedListForJava21Test<E> extends AbstractListTest<
@Override
public List<E> makeObject() {
return new DefaultAbstractLinkedListForJava21<>();
return new DefaultAbstractLinkedListJava21<>();
}
@Override
@ -99,7 +99,7 @@ public class DefaultAbstractLinkedListForJava21Test<E> extends AbstractListTest<
@SuppressWarnings("unchecked")
public void testAddNodeAfter() {
resetEmpty();
final AbstractLinkedListForJava21<E> list = getCollection();
final AbstractLinkedListJava21<E> list = getCollection();
if (!isAddSupported()) {
assertThrows(UnsupportedOperationException.class, () -> list.addFirst(null));
}
@ -130,7 +130,7 @@ public class DefaultAbstractLinkedListForJava21Test<E> extends AbstractListTest<
@SuppressWarnings("unchecked")
public void testGetNode() {
resetEmpty();
final AbstractLinkedListForJava21<E> list = getCollection();
final AbstractLinkedListJava21<E> 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 class DefaultAbstractLinkedListForJava21Test<E> extends AbstractListTest<
@SuppressWarnings("unchecked")
public void testRemoveFirst() {
resetEmpty();
final AbstractLinkedListForJava21<E> list = getCollection();
final AbstractLinkedListJava21<E> list = getCollection();
if (!isRemoveSupported()) {
assertThrows(UnsupportedOperationException.class, list::removeFirst);
}
@ -171,7 +171,7 @@ public class DefaultAbstractLinkedListForJava21Test<E> extends AbstractListTest<
@SuppressWarnings("unchecked")
public void testRemoveLast() {
resetEmpty();
final AbstractLinkedListForJava21<E> list = getCollection();
final AbstractLinkedListJava21<E> list = getCollection();
if (!isRemoveSupported()) {
assertThrows(UnsupportedOperationException.class, list::removeLast);
}
@ -194,7 +194,7 @@ public class DefaultAbstractLinkedListForJava21Test<E> extends AbstractListTest<
if (!isAddSupported() || !isRemoveSupported()) {
return;
}
final AbstractLinkedListForJava21<E> list = getCollection();
final AbstractLinkedListJava21<E> list = getCollection();
list.addAll(Arrays.asList((E[]) new String[] { "value1", "value2" }));
list.removeNode(list.getNode(0, false));