Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8016337

ArrayList.removeAll(null) throws NPE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 8
    • core-libs

      FULL PRODUCT VERSION :
      java8b92

      A DESCRIPTION OF THE PROBLEM :
      ArrayList.removeAll(null); previously didn't do anything on empty lists. With Java 8 it throws an exception. Although this adheres to the contract in the JavaDoc it breaks existing code.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      new ArrayList<String>().removeAll(null);

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      no NPE

      REPRODUCIBILITY :
      This bug can be reproduced always.

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: