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

Character.codePoint{At|Before}(char[], int, int) doesn't do JavaDoc-specified check

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 20
    • None
    • core-libs
    • None
    • b27

      I found out that this code
      public class Main {
          public static void main(String[] args) {
              String s = "Hello world!";
              char[] chars = s.toCharArray();
              int point = Character.codePointAt(chars, -1, 1);
          }
      }
      throws ArrayIndexOutOfBoundsException instead of JavaDoc-specified IndexOutOfBoundsException and the method doesn't check whether index parameter is negative.

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

              Created:
              Updated:
              Resolved: