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

j.l.i.MethodHandles: 'example' section in whileLoop(...) provides example for doWhileLoop

    XMLWordPrintable

    Details

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

      Description

      Please, observe 'example' section for j.l.i.MethodHandles.whileLoop(...)

      The example uses MethodHandles.doWhileLoop(...):
      MethodHandle loop = MethodHandles.doWhileLoop(MH_initZip, MH_zipStep, MH_zipPred);

      Changing 'doWhileLoop' to 'whileLoop' leads to IAE because whileLoop and doWhileLoop have different arguments order. Changing arguments order to

      MethodHandle loop = MethodHandles.whileLoop(MH_initZip, MH_zipPred, MH_zipStep);

      resolves problem.

        Attachments

          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: