List.of().indexOf(null) doesn't throw NullPointerException

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 11
    • Affects Version/s: 9
    • Component/s: core-libs
    • None

      Lists produced by the various List.of() factories does not accept null elements or parameters. For consistency one would expect the same from indexOf.

      Overridden implementations can profitably be implemented to avoid going through AbstractList.indexOf, which allocates iterators to implement the behavior.

      Same issue applies to the lastIndexOf method.

            Assignee:
            Stuart Marks
            Reporter:
            Claes Redestad
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: