Project: Tomcat
Bug 49144 Incorrect lazy initialization and update of static fields?
Reported: 2010-04-16 21:47:20 | Status: resolved fixed

Incorrect lazy initialization and update of static fields: org.apache.catalina.startup.Bootstrap.daemon org.apache.catalina.startup.ContextConfig.contextDigester Findbugs says: This method contains an unsynchronized lazy initialization of a static field. After the field is set, the object stored into that location is further updated or accessed. The setting of the field is visible to other threads as soon as it is set. If the futher accesses in the method that set the field serve to initialize the object, then you have a very serious multithreading bug, unless something else prevents any other thread from accessing the stored object until it is fully initialized. Even if you feel confident that the method is never called by multiple threads, it might be better to not set the static field until the value you are setting it to is fully populated/initialized.

Files changed in fix:
java/org/apache/catalina/startup/Bootstrap.java