Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-240

FileFilterUtils can create cvsFilter and svnFilter more than once

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.0
    • None
    • None

    Description

      FileFilterUtils lazily creates the static fields cvsFilter and svnFilter; however access to the fields is not synchronized and the fields are not volatile.

      One thread can create the filter, but the updated value won't necessarily be seen by any/all other threads.

      This means that the fields can be created multiple times.

      Possible solutions: make the fields volatile, or use the singleton IODH idiom. The latter uses a bit more code, but is probably marginally cheaper if the field is used a lot.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: