Merge "Add a regression test for a Field.isAnnotationPresent crash."
diff --git a/luni/src/main/java/java/util/Collections.java b/luni/src/main/java/java/util/Collections.java
index 4bd1453..491642b 100644
--- a/luni/src/main/java/java/util/Collections.java
+++ b/luni/src/main/java/java/util/Collections.java
@@ -2663,8 +2663,8 @@
private static class SetFromMap<E> extends AbstractSet<E> implements Serializable {
private static final long serialVersionUID = 2454657854757543876L;
- // must named as it, to pass serialization compatibility test.
- private Map<E, Boolean> m;
+ // Must be named as is, to pass serialization compatibility test.
+ private final Map<E, Boolean> m;
private transient Set<E> backingSet;
@@ -2741,7 +2741,7 @@
private static class AsLIFOQueue<E> extends AbstractQueue<E> implements Serializable {
private static final long serialVersionUID = 1802017725587941708L;
- // must named as it, to pass serialization compatibility test.
+ // Must be named as is, to pass serialization compatibility test.
private final Deque<E> q;
AsLIFOQueue(final Deque<E> deque) {
@@ -2829,9 +2829,9 @@
private static final long serialVersionUID = 1578914078182001775L;
- Collection<E> c;
+ final Collection<E> c;
- Class<E> type;
+ final Class<E> type;
public CheckedCollection(Collection<E> c, Class<E> type) {
if (c == null) {
@@ -2915,9 +2915,9 @@
*/
private static class CheckedListIterator<E> implements ListIterator<E> {
- private ListIterator<E> i;
+ private final ListIterator<E> i;
- private Class<E> type;
+ private final Class<E> type;
/**
* Constructs a dynamically typesafe view of the specified ListIterator.
@@ -2975,7 +2975,7 @@
private static final long serialVersionUID = 65247728283967356L;
- List<E> l;
+ final List<E> l;
public CheckedList(List<E> l, Class<E> type) {
super(l, type);
@@ -3076,9 +3076,9 @@
private static final long serialVersionUID = 5742860141034234728L;
- Map<K, V> m;
- Class<K> keyType;
- Class<V> valueType;
+ final Map<K, V> m;
+ final Class<K> keyType;
+ final Class<V> valueType;
private CheckedMap(Map<K, V> m, Class<K> keyType, Class<V> valueType) {
if (m == null) {
@@ -3173,8 +3173,8 @@
* A dynamically typesafe view of a Map.Entry.
*/
private static class CheckedEntry<K, V> implements Map.Entry<K, V> {
- Map.Entry<K, V> e;
- Class<V> valueType;
+ final Map.Entry<K, V> e;
+ final Class<V> valueType;
public CheckedEntry(Map.Entry<K, V> e, Class<V> valueType) {
if (e == null) {
@@ -3209,8 +3209,8 @@
* A dynamically typesafe view of an entry set.
*/
private static class CheckedEntrySet<K, V> implements Set<Map.Entry<K, V>> {
- Set<Map.Entry<K, V>> s;
- Class<V> valueType;
+ final Set<Map.Entry<K, V>> s;
+ final Class<V> valueType;
public CheckedEntrySet(Set<Map.Entry<K, V>> s, Class<V> valueType) {
this.s = s;
@@ -3329,7 +3329,7 @@
*/
private static class CheckedSortedSet<E> extends CheckedSet<E> implements SortedSet<E> {
private static final long serialVersionUID = 1599911165492914959L;
- private SortedSet<E> ss;
+ private final SortedSet<E> ss;
public CheckedSortedSet(SortedSet<E> s, Class<E> type) {
super(s, type);
@@ -3368,7 +3368,7 @@
private static class CheckedSortedMap<K, V> extends CheckedMap<K, V>
implements SortedMap<K, V> {
private static final long serialVersionUID = 1599671320688067438L;
- SortedMap<K, V> sm;
+ final SortedMap<K, V> sm;
CheckedSortedMap(SortedMap<K, V> m, Class<K> keyType, Class<V> valueType) {
super(m, keyType, valueType);