StableList throws the wrong exception type

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 25
    • Component/s: core-libs
    • None

      This code will throw NoSuchElementException instead of IndexOutOfBoundsException and will swallow the message because of the try/catch in ImmutableCollections.ListItr.next/previous:

      StableValue
          .list(42, _ -> {throw new IndexOutOfBoundsException("important message");})
          .listIterator(5)
          .next(); // same for previous()

            Assignee:
            Per-Ake Minborg
            Reporter:
            Per-Ake Minborg
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: