Remove redundant bounds check from AbstractStringBuilder.charAt()

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 18
    • Affects Version/s: None
    • Component/s: core-libs
    • None
    • b09

      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()

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

              Created:
              Updated:
              Resolved: