commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1678598 - /commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/DynamicCombinedConfiguration.java
Date Sun, 10 May 2015 20:07:13 GMT
Author: oheger
Date: Sun May 10 20:07:13 2015
New Revision: 1678598

URL: http://svn.apache.org/r1678598
Log:
Fixed some checkstyle and IntelliJ warnings.

Modified:
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/DynamicCombinedConfiguration.java

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/DynamicCombinedConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/DynamicCombinedConfiguration.java?rev=1678598&r1=1678597&r2=1678598&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/DynamicCombinedConfiguration.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration2/DynamicCombinedConfiguration.java
Sun May 10 20:07:13 2015
@@ -69,7 +69,7 @@ public class DynamicCombinedConfiguratio
      * Stores the current configuration for each involved thread. This value is
      * set at the beginning of an operation and removed at the end.
      */
-    private static final ThreadLocal<CurrentConfigHolder> currentConfig =
+    private static final ThreadLocal<CurrentConfigHolder> CURRENT_CONFIG =
             new ThreadLocal<CurrentConfigHolder>();
 
     /** The CombinedConfigurations */
@@ -608,7 +608,8 @@ public class DynamicCombinedConfiguratio
     }
 
     @Override
-    protected int sizeInternal() {
+    protected int sizeInternal()
+    {
         return this.getCurrentConfig().size();
     }
 
@@ -806,7 +807,7 @@ public class DynamicCombinedConfiguratio
         if (!optimize && cch.getCurrentConfiguration() == null)
         {
             // delegate to beginWrite() which creates the child configuration
-            beginWrite(optimize);
+            beginWrite(false);
             endWrite();
         }
 
@@ -841,7 +842,7 @@ public class DynamicCombinedConfiguratio
     @Override
     protected void endRead()
     {
-        currentConfig.get().getCurrentConfiguration().endRead();
+        CURRENT_CONFIG.get().getCurrentConfiguration().endRead();
         releaseLock();
     }
 
@@ -863,11 +864,11 @@ public class DynamicCombinedConfiguratio
      */
     private void releaseLock()
     {
-        CurrentConfigHolder cch = currentConfig.get();
+        CurrentConfigHolder cch = CURRENT_CONFIG.get();
         assert cch != null : "No current configuration!";
-        if(cch.decrementLockCountAndCheckRelease())
+        if (cch.decrementLockCountAndCheckRelease())
         {
-            currentConfig.remove();
+            CURRENT_CONFIG.remove();
         }
     }
 
@@ -886,8 +887,8 @@ public class DynamicCombinedConfiguratio
         beginRead(false);
         try
         {
-            config = currentConfig.get().getCurrentConfiguration();
-            key = currentConfig.get().getKey();
+            config = CURRENT_CONFIG.get().getCurrentConfiguration();
+            key = CURRENT_CONFIG.get().getKey();
         }
         finally
         {
@@ -949,7 +950,7 @@ public class DynamicCombinedConfiguratio
      */
     private ConfigurationInterpolator initLocalInterpolator()
     {
-        ConfigurationInterpolator ci = new ConfigurationInterpolator()
+        return new ConfigurationInterpolator()
         {
             @Override
             protected Lookup fetchLookupForPrefix(String prefix)
@@ -959,7 +960,6 @@ public class DynamicCombinedConfiguratio
                                 prefix));
             }
         };
-        return ci;
     }
 
     /**
@@ -973,13 +973,13 @@ public class DynamicCombinedConfiguratio
      */
     private CurrentConfigHolder ensureCurrentConfiguration()
     {
-        CurrentConfigHolder cch = currentConfig.get();
+        CurrentConfigHolder cch = CURRENT_CONFIG.get();
         if (cch == null)
         {
             String key = String.valueOf(localSubst.interpolate(keyPattern));
             cch = new CurrentConfigHolder(key);
             cch.setCurrentConfiguration(configs.get(key));
-            currentConfig.set(cch);
+            CURRENT_CONFIG.set(cch);
         }
         return cch;
     }



Mime
View raw message