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

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

XMLWordPrintable

      The spec for j.u.Collections
      http://docs.oracle.com/javase/8/docs/api/java/util/Collections.html
      says:

      "The methods of this class all throw a NullPointerException if the collections or class objects provided to them are null."

      However the following call won't lead to NPE

       java.util.Collections.asLifoQueue((Deque) null)

      The following JCK9 test would fail due to this:
      api/java_util/Collections/td.html#AsLifoQueue[test_NPE]


            psandoz Paul Sandoz
            dbessono Dmitry Bessonov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: