Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-6122

[classlib][luni] java.util.Collections.swap(List<?> list, int i, int j) should throw IndexOutOfBoundsException when i equals to j and is also out of boundary

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.0M8
    • 5.0M10
    • Classlib
    • None
    • Novice

    Description

      Given a test case [1], RI passes while HY fails.
      The java spec specifies that java.util.Collections.wap(List<?> list, int i, int j) should throw IndexOutOfBoundsException when either i or j is out of range.

      [1] Test Case:
      public void test_Collections_swap_IndexOutOfBoundsException() {
      try

      { Collections.swap(new ArrayList(), 3, 3); fail("should throw IndexOutOfBoundsException"); }

      catch (IndexOutOfBoundsException e) {
      // Expected
      }
      }

      Attachments

        1. HARMONY-6122.diff
          1 kB
          Kevin Zhou

        Activity

          People

            nbeyer Nathan Beyer
            zhoukevin Kevin Zhou
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified