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

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

XMLWordPrintable

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

      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.

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

              Created:
              Updated:
              Resolved: