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

[classlib][luni] ArrayList breaks when given concurrent collections as input

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.0M10
    • 5.0M11
    • Classlib
    • None
    • SVN Revision: 784898
    • Patch Available
    • Advanced

    Description

      new ArrayList() and ArrayList.addAll(Collection) assume the passed-in collection will not change between calls.

      In the attached test case, a special collection simulates a background thread calling "remove" after the ArrayList has called size(), but before it has called "toArray()". This causes the collection to return a null-padded array, which leads to a corrupt ArrayList. The attached patch fixes the problem.

      Attachments

        Issue Links

          Activity

            People

              tellison Tim Ellison
              jessewilson Jesse Wilson
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

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