logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattsic...@apache.org
Subject svn commit: r1585311 - /logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
Date Sun, 06 Apr 2014 14:56:10 GMT
Author: mattsicker
Date: Sun Apr  6 14:56:10 2014
New Revision: 1585311

URL: http://svn.apache.org/r1585311
Log:
Add comment regarding proper double-checked locking.

  - Quiets the static code analyzers.

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java?rev=1585311&r1=1585310&r2=1585311&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
Sun Apr  6 14:56:10 2014
@@ -112,6 +112,8 @@ public abstract class ConfigurationFacto
      * @return the ConfigurationFactory.
      */
     public static ConfigurationFactory getInstance() {
+        // volatile works in Java 1.6+, so double-checked locking also works properly
+        //noinspection DoubleCheckedLocking
         if (factories == null) {
             synchronized(TEST_PREFIX) {
                 if (factories == null) {



Mime
View raw message