Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8151179 address issues raised by JCK team on JEP 274 API
  3. JDK-8151738

MethodHandles.countedLoop(MH, MH, MH), body = null leads to NPE instead of IAE

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: P4 P4
    • None
    • None
    • core-libs
    • None

      According to MethodHandles.countedLoop(MH, MH, MH) passing body = null should lead to IllegalArgumentException.

      Actual result is NullPointerException.
      Exception in thread "main" java.lang.NullPointerException
      at java.lang.invoke.MethodHandles.dropArguments(MethodHandles.java:2526)
      at java.lang.invoke.MethodHandles.dropArguments(MethodHandles.java:2601)
      at java.lang.invoke.MethodHandles.countedLoop(MethodHandles.java:3767)
      at java.lang.invoke.MethodHandles.countedLoop(MethodHandles.java:3697)
      at CountedLoopTest1.main(CountedLoopTest1.java:11)


      Was found on jdk9b107/jdk9b108, tests are under development.
      tck_red label will be added after tests completion.

      Example is attached.

      The same situation is in MethodHandles.countedLoop(MH, MH, MH, MH)

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

              Created:
              Updated:
              Resolved: