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

Fix several incorrect usages of Preconditions.checkFromIndexSize

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • None
    • core-libs
    • 18
    • b11

      The Preconditions.checkFromIndexSize has the following signature:

      public static <X extends RuntimeException>
          int checkFromIndexSize(int fromIndex, int size, int length,
                                 BiFunction<String, List<Number>, X> oobef)

      i.e. it takes the "fromIndex" as the first parameter and the size as the second parameter. However, there are places in code right now, where the call to this method incorrectly passes the size as the first parameter and the fromIndex as the second parameter.

            jpai Jaikiran Pai
            jpai Jaikiran Pai
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: