Uploaded image for project: 'Commons CSV'
  1. Commons CSV
  2. CSV-34

CSVFormat describes itself as immutable, but it is not - in particular it is not thread-safe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0
    • None
    • None

    Description

      CSVFormat describes itself as immutable, but it is not @Immutable - the class fields are all mutable.

      The methods that change the fields do so by creating a clone, and returning the changed clone.
      So in a sense the class is immutable.

      However, the normal expectation is that @Immutable classes are @ThreadSafe.
      CSVFormat is not thread-safe, because the fields are not volatile, and the fields are not written & read using a common lock.

      The comment needs to be clarified or removed.

      Attachments

        1. CSVFormat.java
          10 kB
          Sebb

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: