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

NoSuchMethodException when method name contains NULL or Latin-1 supplement character

    XMLWordPrintable

Details

    • b93
    • b146
    • generic
    • generic
    • Verified

    Description

      FULL PRODUCT VERSION :
      java version "9-ea"
      Java(TM) SE Runtime Environment (build 9-ea+132)
      Java HotSpot(TM) 64-Bit Server VM (build 9-ea+132, mixed mode)

      A DESCRIPTION OF THE PROBLEM :
      When the name of a generated method contains the NULL character (U+0000) or a Latin-1 supplement character (U+0080 - U+00FF), a java.lang.NoSuchMethodException is thrown when trying to call that method.

      REGRESSION. Last worked in version 8u102

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.8.0_102"
      Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Execute in jjs:

      jjs> ({get "\0"(){}})["\0"]
      jdk.nashorn.internal.lookup.MethodHandleFactory$LookupException: java.lang.NoSuchMethodException: no such method: jdk.nashorn.internal.scripts.Script$Recompilation$2$2$\^shell\_/585324508.get (Object)Object/invokeStatic

      jjs> ({get "\x80"(){}})["\x80"]
      jdk.nashorn.internal.lookup.MethodHandleFactory$LookupException: java.lang.NoSuchMethodException: no such method: jdk.nashorn.internal.scripts.Script$Recompilation$5$2$\^shell\_/1866875501.get €(Object)Object/invokeStatic

      jjs> ({get "\xff"(){}})["\xff"]
      jdk.nashorn.internal.lookup.MethodHandleFactory$LookupException: java.lang.NoSuchMethodException: no such method: jdk.nashorn.internal.scripts.Script$Recompilation$8$2$\^shell\_/1910438136.get ÿ(Object)Object/invokeStatic

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      No NoSuchMethodExceptions are thrown.
      ACTUAL -
      NoSuchMethodExceptions are thrown.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      Attachments

        Issue Links

          Activity

            People

              thartmann Tobias Hartmann
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: