Uploaded image for project: 'Commons VFS'
  1. Commons VFS
  2. VFS-374

Incorrect lazy initialization of static field org.apache.commons.vfs2.util.Messages.resources in org.apache.commons.vfs2.util.Messages.findMessage(String)

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.1
    • Labels:
      None
    • Environment:

      Description

      FindBugs Eclipse plugin reports:
      Bug: Incorrect lazy initialization of static field org.apache.commons.vfs2.util.Messages.resources in org.apache.commons.vfs2.util.Messages.findMessage(String)

      This method contains an unsynchronized lazy initialization of a non-volatile static field. Because the compiler or processor may reorder instructions, threads are not guaranteed to see a completely initialized object, if the method can be called by multiple threads. You can make the field volatile to correct the problem. For more information, see the Java Memory Model web site.

      Confidence: Normal, Rank: Troubling (14)
      Pattern: LI_LAZY_INIT_STATIC
      Type: LI, Category: MT_CORRECTNESS (Multithreaded correctness)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ggregory Gary Gregory
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: