Skip to content

Commit

Permalink
Slightly less bad new class name
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Oct 21, 2024
1 parent c7fc724 commit a910ebd
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
*
* @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> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
* (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:
Expand All @@ -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;

Expand Down Expand Up @@ -105,7 +105,7 @@ protected static class LinkedListIterator<E> implements ListIterator<E>, 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<E> parent, final int fromIndex)
protected LinkedListIterator(final AbstractLinkedListJava21<E> parent, final int fromIndex)
throws IndexOutOfBoundsException {
this.parent = parent;
this.expectedModCount = parent.modCount;
Expand Down Expand Up @@ -221,21 +221,21 @@ public void set(final E obj) {
}

/**
* 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 */
int size;
/** 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);
}
Expand Down Expand Up @@ -527,15 +527,15 @@ 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() {
}

/**
* Constructs a list copying data from the specified collection.
*
* @param coll the collection to copy
*/
protected AbstractLinkedListForJava21(final Collection<? extends E> coll) {
protected AbstractLinkedListJava21(final Collection<? extends E> coll) {
init();
addAll(coll);
}
Expand Down Expand Up @@ -597,7 +597,7 @@ protected void addNode(final Node<E> nodeToInsert, final Node<E> insertBeforeNod
* {@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
Expand All @@ -613,7 +613,7 @@ protected void addNodeAfter(final Node<E> node, final E value) {
* {@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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
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();
}

Expand Down Expand Up @@ -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<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) {
Expand All @@ -76,8 +76,8 @@ protected void checkNodes() {
}

@Override
public AbstractLinkedListForJava21<E> getCollection() {
return (AbstractLinkedListForJava21<E>) super.getCollection();
public AbstractLinkedListJava21<E> getCollection() {
return (AbstractLinkedListJava21<E>) super.getCollection();
}

@Override
Expand All @@ -87,7 +87,7 @@ public String getCompatibilityVersion() {

@Override
public List<E> makeObject() {
return new DefaultAbstractLinkedListForJava21<>();
return new DefaultAbstractLinkedListJava21<>();
}

@Override
Expand All @@ -99,7 +99,7 @@ protected boolean skipSerializedCanonicalTests() {
@SuppressWarnings("unchecked")
public void testAddNodeAfter() {
resetEmpty();
final AbstractLinkedListForJava21<E> list = getCollection();
final AbstractLinkedListJava21<E> list = getCollection();
if (!isAddSupported()) {
assertThrows(UnsupportedOperationException.class, () -> list.addFirst(null));
}
Expand Down Expand Up @@ -130,7 +130,7 @@ public void testAddNodeAfter() {
@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.");
Expand All @@ -149,7 +149,7 @@ public void testGetNode() {
@SuppressWarnings("unchecked")
public void testRemoveFirst() {
resetEmpty();
final AbstractLinkedListForJava21<E> list = getCollection();
final AbstractLinkedListJava21<E> list = getCollection();
if (!isRemoveSupported()) {
assertThrows(UnsupportedOperationException.class, list::removeFirst);
}
Expand All @@ -171,7 +171,7 @@ public void testRemoveFirst() {
@SuppressWarnings("unchecked")
public void testRemoveLast() {
resetEmpty();
final AbstractLinkedListForJava21<E> list = getCollection();
final AbstractLinkedListJava21<E> list = getCollection();
if (!isRemoveSupported()) {
assertThrows(UnsupportedOperationException.class, list::removeLast);
}
Expand All @@ -194,7 +194,7 @@ public void testRemoveNode() {
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));
Expand Down

0 comments on commit a910ebd

Please sign in to comment.