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 29957558cf0db700bfaae360a80c42dc3871d0e5. 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
(cherry picked from commit 3e090b8032714c0912697b678b8ab9d26bc1739b)
diff --git a/ojluni/src/main/java/java/util/concurrent/CopyOnWriteArrayList.java b/ojluni/src/main/java/java/util/concurrent/CopyOnWriteArrayList.java
index 2a5f5de..d3d681f 100644
--- a/ojluni/src/main/java/java/util/concurrent/CopyOnWriteArrayList.java
+++ b/ojluni/src/main/java/java/util/concurrent/CopyOnWriteArrayList.java
@@ -100,21 +100,22 @@
     final transient Object lock = new Object();
 
     /** The array, accessed only via getArray/setArray. */
-    private transient volatile Object[] array;
+    // Android-changed: renamed array -> elements for backwards compatibility b/33916927
+    private transient volatile Object[] elements;
 
     /**
      * Gets the array.  Non-private so as to also be accessible
      * from CopyOnWriteArraySet class.
      */
     final Object[] getArray() {
-        return array;
+        return elements;
     }
 
     /**
      * Sets the array.
      */
     final void setArray(Object[] a) {
-        array = a;
+        elements = a;
     }
 
     /**