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

Mistake in documentation of ArrayList#removeRange

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 7
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:

      Description

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      Link to documentation:
      http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html#removeRange(int,%20int)

      According to the documentation, an IndexOutOfBoundsException is thrown if (fromIndex < 0 || fromIndex >= size() || toIndex > size() || toIndex < fromIndex).

      However, no Exception is thrown on removeRange(size(), size()). Removing the condition (fromIndex >= size()) from the documentation should fix the mistake.


      REPRODUCIBILITY :
      This bug can be reproduced always.

        Attachments

          Activity

            People

            Assignee:
            igerasim Ivan Gerasimov
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: