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

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

    Details

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

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: