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

java.lang.String methods not available on concatenated strings

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8u40, 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b39
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Backports

        Description


        Code for reproduce :

        print("JS + JS")
        print(("" + "").replace)
        print(("" + "").replaceAll)

        print("Java + JS")
        print((new java.lang.String("")+ "").replace)
        print((new java.lang.String("") + "").replaceAll)

        print("Types are same")
        print((new java.lang.String("")+ "").class)
        print(("" + "").class)

        Output :

        JS + JS
        function replace() { [native code] }
        [jdk.internal.dynalink.beans.SimpleDynamicMethod String java.lang.String.replaceAll(String,String)]

        Java + JS
        function replace() { [native code] }
        undefined

        Types are same
        class java.lang.String
        class java.lang.String

        reproducing in jdk 9b37/8u40b12 with/without OT

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                hannesw Hannes Wallnoefer
                Reporter:
                slugovoy Sergey Lugovoy (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: