j.l.i.MethodHandles.whileLoop(...) fails with IOOBE in the case 'init' is null, 'step' and 'pred' have parameters

XMLWordPrintable

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

      According to documentation j.l.i.MethodHandles.whileLoop(MethodHandle, MethodHandle, MethodHandle), 'init' might be null:

      Passing null init function will make the loop's result type void.

      Attached code provides example which throws IndexOutOfBoundsException; java.lang.IndexOutOfBoundsException: toIndex = 1
      According to MethodHandles.loop(MethodHandle[]...), IllegalArgumentException should be thrown.

      Was found on jdk9b107, tests are in development, tck_red label will be added after tests development completion.

            Assignee:
            Michael Haupt
            Reporter:
            Anastasiya Solodkaya (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: