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

java.lang.String methods not available on concatenated strings

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 9
    • 8u40, 9
    • core-libs
    • None
    • b39
    • generic
    • generic
    • 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

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

                Dates

                  Created:
                  Updated:
                  Resolved: