diff --git a/classlib/src/main/java/org/teavm/classlib/java/util/TLinkedList.java b/classlib/src/main/java/org/teavm/classlib/java/util/TLinkedList.java index d91237ac4..6ed9bc27d 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/util/TLinkedList.java +++ b/classlib/src/main/java/org/teavm/classlib/java/util/TLinkedList.java @@ -348,7 +348,6 @@ public class TLinkedList extends TAbstractSequentialList implements TDeque } else if (currentEntry == nextEntry) { nextEntry = hasPrevious() ? prevEntry.next : null; } - --size; version = modCount; currentEntry = null; } diff --git a/tests/src/test/java/org/teavm/classlib/java/util/LinkedListTest.java b/tests/src/test/java/org/teavm/classlib/java/util/LinkedListTest.java index 5f6e4dcb0..1214a7558 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/LinkedListTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/LinkedListTest.java @@ -106,6 +106,7 @@ public class LinkedListTest { assertEquals(2, iter.nextIndex()); assertEquals("a", iter.next()); assertArrayEquals(new String[] { "1", "2", "a", "b" }, list.toArray(new String[0])); + assertEquals(4, list.size()); } @Test @@ -138,6 +139,7 @@ public class LinkedListTest { iter.remove(); assertEquals(1, iter.nextIndex()); assertEquals("3", iter.next()); + assertEquals(4, list.size()); } @Test(expected = IllegalStateException.class) @@ -195,7 +197,7 @@ public class LinkedListTest { } @Test - public void removesFirstOccurence() { + public void removesFirstOccurrence() { LinkedList list = new LinkedList<>(); list.addAll(Arrays.asList("1", "2", "3", "1", "2")); assertFalse(list.removeFirstOccurrence("*")); @@ -205,7 +207,7 @@ public class LinkedListTest { } @Test - public void removesLastOccurence() { + public void removesLastOccurrence() { LinkedList list = new LinkedList<>(); list.addAll(Arrays.asList("1", "2", "3", "1", "2")); assertFalse(list.removeLastOccurrence("*"));