History log of /libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/ArrayListTest.java
Revision Date Author Comments
5d175dd4d7b128492ef7e3da6a77d80b8fd0aa22 02-Mar-2017 Tobias Thierer <tobiast@google.com> Automated: Canonicalize spelling of Android-changed across libcore

This applies the same regexp replacement across libcore that
http://r.android.com/345826 had only applied to ojluni.

Most of the previous noncanonical spellings were a lowercased
"android-" that should be "Android-".

This CL was created by running the following command on top of
the above CL. No manual changes were made.

find . -name \*\.java | xargs sed -i \
-e 's/Android[- ]changed/Android-changed/ig' \
-e 's/Android-changed :/Android-changed:/g' \
-e 's/Android-changed \(BEGIN\|END\)/\1 Android-changed/g' \
-e 's/Android-changed - /Android-changed: /g' \
-e 's/Android[- ]removed/Android-removed/ig' \
-e 's/Android-removed :/Android-removed:/g' \
-e 's/Android-removed \(BEGIN\|END\)/\1 Android-removed/g' \
-e 's/Android-removed - /Android-removed: /g' \
-e 's/Android[- ]added/Android-added/ig' \
-e 's/Android-added :/Android-added:/g' \
-e 's/Android-added \(BEGIN\|END\)/\1 Android-added/g' \
-e 's/Android-added - /Android-added: /g' \
-e 's/----- \(BEGIN\|END\) android\( -----\)\?/\1 Android-changed/g' \
-e 's/\/\* \(BEGIN\|END\) Android-changed \*\//\/\/ \1 Android-changed/g'

Bug: 35841464
Test: make droid cts

Change-Id: I060c7236b7607763e5d27d60aa395d2507703a95
508f0abe4f8686d29466b2c364cb4f60bf0484b5 16-Jan-2017 Tobias Thierer <tobiast@google.com> Basic tests for wrapper Collection factories in java.util.Collections

Basic test coverage for the wrapper Collections constructed by
the following static factory methods in java.util.Collections:

checkedNavigableMap()
checkedNavigableSet()
checkedQueue()
emptyNavigableMap()
emptyNavigableSet()
emptySortedMap()
emptySortedSet()
synchronizedNavigableMap()
synchronizedNavigableSet()
unmodifiableNavigableMap()
unmodifiableNavigableSet()

These 11 methods under test are the only ones currently annotated
@hide in Collections.java; this CL provides sufficient test coverage
for those to be un-hidden in a follow-up CL.

Most (perhaps all) aspects covered by these tests are also covered
by guava-testlib-21.0 tests, but those are not yet available in
AOSP and would take 80min to run, whereas these new tests only take
a few seconds to run.

SpliteratorTester previously contained some overly strict assertions
that Spliterator.trySplit() != null. This CL relaxes this assumption
for non-empty spliterables but adds a separate assertSupportsTrySplit()
check in the places that previously exercised this strict test logic;
Where the old tests appeared to be testing the wrong collection (e.g.
in HashSetTest), this CL asserts the support for trySplit on what
appears to be the correct Collection, but does not otherwise fix the
existing test code.

Bug: 29935305
Test: CtsLibcoreTestCases
Change-Id: Ibeac242bb60df7b06a1c8c80dc744707f734d91c
def94956afbfc17ea65390d16d032f9b790a5dca 18-Mar-2016 Narayan Kamath <narayan@google.com> Spliterators: pull in additional specializations.

This change also pulls in a few javadoc improvements to Collections
to make our lives easier.

bug: 27605529

(cherry picked from commit c86e0fa98d8274d7ea01213a20e3a14575406dd0)

Change-Id: I97f05ae833034f1e5a7d32329f8e19de6b97e779
c86e0fa98d8274d7ea01213a20e3a14575406dd0 18-Mar-2016 Narayan Kamath <narayan@google.com> Spliterators: pull in additional specializations.

This change also pulls in a few javadoc improvements to Collections
to make our lives easier.

bug: 27605529

Change-Id: I3947697e18c057a864a6d13af0569b02acd64206
887ab3fe607c582e10e33b3d631401d7a791aaed 17-Mar-2016 Narayan Kamath <narayan@google.com> Vector: Rework CME checks in hasNext() and next().

Port over commit b10b2a3ab693cfd6156d06ffe4e00ce69b9c9194
from java.util.ArrayList to java.util.Vector.

Also adds the same set of tests to Vector / ArrayList so
to make sure their iterators behave identically in this regard.

bug: 27430229

(cherry picked from commit 6e5b758a4438d2c154dd11a5c04d14a5d2fc907c)

Change-Id: I04cadc3eac6d591ce8b93d04a999825f65fb867a
6e5b758a4438d2c154dd11a5c04d14a5d2fc907c 17-Mar-2016 Narayan Kamath <narayan@google.com> Vector: Rework CME checks in hasNext() and next().

Port over commit b10b2a3ab693cfd6156d06ffe4e00ce69b9c9194
from java.util.ArrayList to java.util.Vector.

Also adds the same set of tests to Vector / ArrayList so
to make sure their iterators behave identically in this regard.

bug: 27430229

Change-Id: Idd8e44737a216ac5ea9f1e6fed8892b364997292
5c35c7ebda68cc39b6bdee20f678a150336ebd1d 14-Mar-2016 Yi Kong <yikong@google.com> Port java.util.Collection.removeIf from OpenJDK8

Source code is taken from jdk8u60.

Bug: 27538943
Change-Id: I485c024f87871e33d2f455be9807775601af77ee
(cherry picked from commit d41ca4a76ea570f9dd89a7ae56410cc75cc0a856)
d41ca4a76ea570f9dd89a7ae56410cc75cc0a856 14-Mar-2016 Yi Kong <yikong@google.com> Port java.util.Collection.removeIf from OpenJDK8

Source code is taken from jdk8u60.

Bug: 27538943
Change-Id: I485c024f87871e33d2f455be9807775601af77ee
3a923d039f9176b87d6ee449e9b263cf5cd902ed 11-Mar-2016 Narayan Kamath <narayan@google.com> Fix cts-v1 build breakage.

We're still using javac for CollectAllTests and javac complains
about referencing a variable that isn't effectively final from a
lambda expression. Jack erroneously doesn't complain (b/27605155).

bug: 27426688

(cherry picked from commit b9050f600e72322f8d86db21ab9b0d41aff860e7)

Change-Id: I2870e18cfb088dd25a660b6a68c4dc23c1d3cc2e
b9050f600e72322f8d86db21ab9b0d41aff860e7 11-Mar-2016 Narayan Kamath <narayan@google.com> Fix cts-v1 build breakage.

We're still using javac for CollectAllTests and javac complains
about referencing a variable that isn't effectively final from a
lambda expression. Jack erroneously doesn't complain (b/27605155).

bug: 27426688
Change-Id: I96581185c124c237f84910e633b652544d48a6c0
8b056f0b15bc1e45da8d4c504353b05e681ac013 04-Mar-2016 Narayan Kamath <narayan@google.com> Add java.lang.Iterable.spliterator() and supporting classes.

The only android specific changes here are to HashMap - their
spliterators add Spliterator.ORDERED if the HashMap is an instance
of a LinkedHashMap.

There's some degree of duplication between the test code used to
exercise primitive arrays (Arrays / Spliterators provide similar
APIs). These differences are quite hard to consolidate, since the
Arrays version declares that their Spliterators are ORDERED but
the Spliterator version doesn't. The latter also allows us to declare
additional Spliterator characteristics.

bug: 27426688
Change-Id: I191a9319d4af7e22834f2d91f73634a227b36bc2
4c89023ef86f29fa9add7db2574f2169fe842577 04-Mar-2016 Narayan Kamath <narayan@google.com> Add java.lang.Iterable.spliterator() and supporting classes.

The only android specific changes here are to HashMap - their
spliterators add Spliterator.ORDERED if the HashMap is an instance
of a LinkedHashMap.

There's some degree of duplication between the test code used to
exercise primitive arrays (Arrays / Spliterators provide similar
APIs). These differences are quite hard to consolidate, since the
Arrays version declares that their Spliterators are ORDERED but
the Spliterator version doesn't. The latter also allows us to declare
additional Spliterator characteristics.

(cherry-picked from commit ed21aa3a8dcd34eca6f0317eeb683e7afdc825b9)

bug: 27426688
Change-Id: I191a9319d4af7e22834f2d91f73634a227b36bc2
3984cdba314a0f7b0587000dec99ff26fd9bcbb5 02-Mar-2016 Narayan Kamath <narayan@google.com> Add Iterator.forEachRemaining / Iterator.remove.

Also pulls in various specializations from concrete subclasses.

bug: 27426688

(cherry picked from commit e633814ad4dc6c7dc0c34080292c2c9622cbd5a3)

Change-Id: Ic778fb61768ec2495e1ac17029afbdfd97d5e6db
e633814ad4dc6c7dc0c34080292c2c9622cbd5a3 02-Mar-2016 Narayan Kamath <narayan@google.com> Add Iterator.forEachRemaining / Iterator.remove.

Also pulls in various specializations from concrete subclasses.

bug: 27426688
Change-Id: I4d37bb61973447b5621fc2b389a04d40666a941d
60796efea3a74e02aea384b8eb56103ea21b880b 29-Feb-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Add Iterable#forEach & Map#forEach from openJdk8

Based on openJdk 8u40 source & iam@ stream change in
ag/872080

Bug: 27404545
Change-Id: Ic67e20b35c24e7acce513e010b727510af09a83e
(cherry picked from commit c3a9db83a352d92d5a6e0098f22bde07e34a1d3b)
c3a9db83a352d92d5a6e0098f22bde07e34a1d3b 29-Feb-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Add Iterable#forEach & Map#forEach from openJdk8

Based on openJdk 8u40 source & iam@ stream change in
ag/872080

Bug: 27404545
Change-Id: Ic67e20b35c24e7acce513e010b727510af09a83e
b10b2a3ab693cfd6156d06ffe4e00ce69b9c9194 26-Nov-2015 Narayan Kamath <narayan@google.com> Fix ConcurrentModificationException in ArrayList iterators.

OpenJdk's hasNext() implementation always checks the current size
of the list so it's possible for this function to return "false"
and then "true" if an element is subsequently added. Attempting to
iterate over that element will throw a ConcurrentModificationException.

The unit-test demonstrates the sequence of operations applications
were performing, usually from a (for : each) loop of listeners where the
last listener would add stuff to the list.

bug: 25867131
bug: 25867396
bug: 25866843
bug: 25866828

Change-Id: I785a3a44aba22e6872b9471551011f0dd28458de
ab762bb740405d0fefcccf4a0899a234f995be13 15-Nov-2013 Narayan Kamath <narayan@google.com> Move tests from tests/api to harmony-tests. (Take 2)

This reverts commit d5e281743e55e1daa297fd8043b2d9b6e8e1bed2.

The makefile issue that caused the original build break
has been resolved.
d5e281743e55e1daa297fd8043b2d9b6e8e1bed2 15-Nov-2013 Narayan Kamath <narayan@google.com> Revert "Move tests from tests/api to harmony-tests."

This reverts commit 81bf28ad31131815d0a36a43a0eca3c29aefdfcd.

Breaks build

Change-Id: I3f1562921ffe8fdbec36971dd65db398c27c92db
81bf28ad31131815d0a36a43a0eca3c29aefdfcd 15-Nov-2013 Narayan Kamath <narayan@google.com> Move tests from tests/api to harmony-tests.

The vast majority of cleaned up harmony tests
are now in harmony-tests/src/test/org/apache/harmony/tests/

Change-Id: I56c2e484ff434b5618cf6751d602ae9f0db96b30