Commit 3e090b80 authored by Tobias Thierer's avatar Tobias Thierer
Browse files

App compat: Temporarily rename CopyOnWriteArrayList.array -> elements

Up to version 1.5.2 [1], the streamsupport library used reflection
to access some private fields. Streamsupport 1.5.3 (2016-12-17)
fixed this by delegating to the platform's spliterators instead.

[1] https://github.com/streamsupport/streamsupport/tree/1.5.2

A popular app is still using streamsupport 1.5.2, which breaks
before this CL because it relies on the private field name
CopyOnWriteArrayList.elements that was replaced by the field "array"
in libcore commit 29957558. This CL
renames the field back to "elements" for now so that this app does
not break.

Streamsupport 1.5.1 already broke on Android N (bug 32029582), so
attempting to start supporting it now is infeasible / pointless.

This CL should be reverted once enough apps have stopped relying
on streamsupport 1.5.2.

Test: Manually checked that I was able to reproduce the crash in the
      app from bug 33916927 on an internal build from today.
Test: Manually checked that the crash in the app from bug 33916927 no
      longer occurs on an internal build after patching in this CL.
Test: Manually verified through code [1] inspection that the other
      Collection subclass field names that streamsupport 1.5.2's
      Spliterator implementations rely on match the ones currently
      in AOSP. No empirical testing of any other apps nor of new
      test code was performed.

Bug: 33916927
Change-Id: I29e6e72dec98b1934cd0198492bf1891838f04bd
parent 8de4fb68
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment