RFR 8145006 Collections.asLifoQueue(null) doesn't throw NPE as specified

Paul Sandoz paul.sandoz at oracle.com
Thu Dec 10 10:19:07 UTC 2015


Hi,

This is a small fix to Collections.asLifoQueue to throw an NPE if the deque passed is null as per the requirements on the class doc [1], rather than throwing an NPE when the Queue is operated on:

  http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8145006-Collections-LIFO-no-NPE/webrev/

It's a small behavioural change (a matter of where the NPE will occur, earlier rather than later if the Queue is operated on), so it will also require a CCC.

Paul.

[1]
* <p>The methods of this class all throw a {@code NullPointerException}
* if the collections or class objects provided to them are null.



More information about the core-libs-dev mailing list