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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 9
    • None
    • core-libs

    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

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

              Dates

                Created:
                Updated:
                Resolved: