commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1516573 - in /commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration: AbstractConfiguration.java convert/DefaultConversionHandler.java
Date Thu, 22 Aug 2013 19:59:12 GMT
Author: oheger
Date: Thu Aug 22 19:59:12 2013
New Revision: 1516573

URL: http://svn.apache.org/r1516573
Log:
Added a constant for a default instance to DefaultConversionHandler.

It is safe to share an instance of this class between multiple components.
Therefore, a default instance can be defined and used anywhere.

Modified:
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/AbstractConfiguration.java
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/convert/DefaultConversionHandler.java

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/AbstractConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/AbstractConfiguration.java?rev=1516573&r1=1516572&r2=1516573&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/AbstractConfiguration.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/AbstractConfiguration.java
Thu Aug 22 19:59:12 2013
@@ -140,10 +140,6 @@ public abstract class AbstractConfigurat
     /** end token */
     protected static final String END_TOKEN = "}";
 
-    /** The default {@code ConversionHandler} instance. */
-    private static final ConversionHandler DEF_CONVERSION_HANDLER =
-            new DefaultConversionHandler();
-
     /** The list delimiter handler. */
     private ListDelimiterHandler listDelimiterHandler;
 
@@ -174,7 +170,7 @@ public abstract class AbstractConfigurat
         setLogger(null);
         installDefaultInterpolator();
         listDelimiterHandler = DisabledListDelimiterHandler.INSTANCE;
-        conversionHandler = DEF_CONVERSION_HANDLER;
+        conversionHandler = DefaultConversionHandler.INSTANCE;
     }
 
     /**

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/convert/DefaultConversionHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/convert/DefaultConversionHandler.java?rev=1516573&r1=1516572&r2=1516573&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/convert/DefaultConversionHandler.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/convert/DefaultConversionHandler.java
Thu Aug 22 19:59:12 2013
@@ -50,6 +50,14 @@ import org.apache.commons.lang3.ClassUti
  */
 public class DefaultConversionHandler implements ConversionHandler
 {
+    /**
+     * A default instance of this class. Because an instance of this class can
+     * be shared between arbitrary objects it is possible to make use of this
+     * default instance anywhere.
+     */
+    public static final DefaultConversionHandler INSTANCE =
+            new DefaultConversionHandler();
+
     /** The default format for dates. */
     public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
 



Mime
View raw message