Commits

Anonymous committed 9e6d7ff Merge

Merge "Add explicit null check in ArrayList"

Comments (0)

Files changed (1)

luni/src/main/java/java/util/ArrayList.java

      *            the collection of elements to add.
      */
     public ArrayList(Collection<? extends E> collection) {
+        if (collection == null) {
+            throw new NullPointerException("collection == null");
+        }
+
         Object[] a = collection.toArray();
         if (a.getClass() != Object[].class) {
             Object[] newArray = new Object[a.length];