Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-505

TestUtils is thread-hostile

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2, 2.0, 2.1
    • 3.0
    • None
    • None

    Description

      TestUtils has several mutable static fields which are not synchronised, or volatile.

      If one of the fields is updated by thread A, there is no guarantee that thread B will see the full update - it may see a partially updated object.

      Furthermore, at least some of the static fields reference a mutable object, which can be changed whilst another thread is using it.

      As far as I can tell, this class must only ever be used by a single thread otherwise the results will be unpredictable.

      Attachments

        Activity

          People

            sebb Sebb
            sebb Sebb
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: