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

MethodHandles.iteratedLoop(...) fails with CCE in the case of iterating over array

XMLWordPrintable

      According to MethodHandles.iteratedLoop(...) documentation's last constraint, following input is allowed:
      iterator=null
      init=()I
      body=(I, String[])I

      Please, observe two examples (Example0 and Example1) showing that loop run fails in this case. Note that loop handle was created successfully in both examples.

      Thrown exception: Exception in thread "main" java.lang.ClassCastException: Cannot cast [Ljava.lang.String; to java.lang.Iterable

      Was found on jdk9b140

            psandoz Paul Sandoz
            asolodkaya Anastasiya Solodkaya (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: