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

StringBuffer(CharSequence) constructor truncates when -XX:-CompactStrings specified

    XMLWordPrintable

Details

    • b16
    • Verified

    Description

      If Compact Strings is disabled, the StringBuffer/StringBuilder(CharSequence)
      constructor truncates the string in half, eg:
              StringBuffer sb2 = new StringBuffer((CharSequence)new StringBuffer("test2"));
              System.out.println(sb2);
              System.out.println(sb2.toString().equals("test2"));

      Results in output ==>
          tes
          false

      JDK13 regression from change JDK-8218227

      Attachments

        Issue Links

          Activity

            People

              aleonard Andrew Leonard
              aleonard Andrew Leonard
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: