JDK-8016337 : ArrayList.removeAll(null) throws NPE
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:collections
  • Affected Version: 8
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: os_x
  • Submitted: 2013-06-11
  • Updated: 2021-03-03
  • Resolved: 2013-06-11
Related Reports
Duplicate :  
Description
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.