Commons Logging
  1. Commons Logging
  2. LOGGING-147

SimpleLog.log - unsafe update of shortLogName

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.1
    • Fix Version/s: 1.1.2
    • Labels:
      None

      Description

      shortLogName is lazily updated, but:

      1) field is not volatile, so is not safely published
      2) fiels is written twice, so if log is called by two threads, one might get a partial update.

        Activity

        Hide
        Sebb added a comment -

        Used temporary string to avoid possible update window.
        Does not matter so much that the field is not volatile, as the worst that can happen is the field is updated twice.

        URL: http://svn.apache.org/viewvc?rev=1363173&view=rev
        Log:
        LOGGING-147 - SimpleLog.log - unsafe update of shortLogName

        Modified:
        commons/proper/logging/trunk/RELEASE-NOTES.txt
        commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/SimpleLog.java

        Show
        Sebb added a comment - Used temporary string to avoid possible update window. Does not matter so much that the field is not volatile, as the worst that can happen is the field is updated twice. URL: http://svn.apache.org/viewvc?rev=1363173&view=rev Log: LOGGING-147 - SimpleLog.log - unsafe update of shortLogName Modified: commons/proper/logging/trunk/RELEASE-NOTES.txt commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/SimpleLog.java

          People

          • Assignee:
            Unassigned
            Reporter:
            Sebb
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development