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

Remove redundant bounds check from AbstractStringBuilder.charAt()

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • None
    • 18
    • core-libs
    • None
    • b09

    Description

      AbstractStringBuilder.charAt(int) does bounds check before calling charAt() (for non-latin Strings):

      @Override
      public char charAt(int index) {
          checkIndex(index, count);
          if (isLatin1()) {
              return (char)(value[index] & 0xff);
          }
          return StringUTF16.charAt(value, index);
      }

      This can be improved by removing bounds check from ASB.charAt() in favour of one in String*.charAt()

      Attachments

        Issue Links

          Activity

            People

              stsypanov Sergey Tsypanov
              stsypanov Sergey Tsypanov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: