summaryrefslogtreecommitdiff
path: root/annotations/generate_annotated_java_files.py
diff options
context:
space:
mode:
authorTobias Thierer <tobiast@google.com>2017-01-06 21:18:42 +0000
committerTobias Thierer <tobiast@google.com>2017-01-27 10:00:09 +0000
commit82637e04484beb79b20b5e619b8ada7403d08c77 (patch)
treecb2d80b0def5c2cd2a26b44d56932e45770c2bd6 /annotations/generate_annotated_java_files.py
parent7770023b896770c3c679bd7b46697c753eaa4ac2 (diff)
Check ORDERED Collection Spliterators consistency with Iterator
The documentation at developer.android.com/reference/java/util/Spliterator.html#ORDERED requires ordered Collection.spliterator() implementations to have consistent ordering with Collection.iterator(). This CL adds coverage for this to SpliteratorTester.runOrderedTest(). The fact that this was not previously covered was a contributing factor in a bug in LinkedHashMap.spliterator()'s order in Android N not having been found. This bug has already been fixed in Android O. Note that the same behavior is also covered by tests in guava-testlib-21.0 that have not yet been added to AOSP. SpliteratorTester.runOrderedTest() contains some checks for trySplit() that appear somewhat misplaced since they are unrelated to the ORDERED characteristic. This CL refactors these to be more meaningful, but doesn't bother breaking them out into a separate/differently named test helper method for now. Some (buggy) collections currently incorrectly report their ordered spliterators as not having the ORDERED characteristic, so this CL refrains from adding such an assertion in the shared test logic for now. Test: CtsLibcoreTestCases Bug: 34242647 Bug: 34757089 Change-Id: I8a0b739de8014726c69bc8bb3fccd51c6d26b268
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions