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

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

    XMLWordPrintable

Details

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

    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

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

            Dates

              Created:
              Updated:
              Resolved: