commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1502840 - in /commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration: AbstractConfiguration.java DisabledListDelimiterHandler.java
Date Sat, 13 Jul 2013 19:22:09 GMT
Author: oheger
Date: Sat Jul 13 19:22:08 2013
New Revision: 1502840

URL: http://svn.apache.org/r1502840
Log:
Added a constant for a default instance of DisabledListDelimiterHandler.

An instance of DisabledListDelimiterHandler can be shared between arbitrary
configuration objects. So it is safe to use this instance whenever such an
object is needed.

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/DisabledListDelimiterHandler.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=1502840&r1=1502839&r2=1502840&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
Sat Jul 13 19:22:08 2013
@@ -126,10 +126,6 @@ public abstract class AbstractConfigurat
      */
     public static final int EVENT_READ_PROPERTY = 5;
 
-    /** Constant for the default list delimiter handler. */
-    private static final ListDelimiterHandler DEFAULT_LIST_DELIMITER_HANDLER =
-            new DisabledListDelimiterHandler();
-
     /** start token */
     protected static final String START_TOKEN = "${";
 
@@ -174,7 +170,7 @@ public abstract class AbstractConfigurat
         interpolator = new AtomicReference<ConfigurationInterpolator>();
         setLogger(null);
         installDefaultInterpolator();
-        listDelimiterHandler = DEFAULT_LIST_DELIMITER_HANDLER;
+        listDelimiterHandler = DisabledListDelimiterHandler.INSTANCE;
     }
 
     /**

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/DisabledListDelimiterHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/DisabledListDelimiterHandler.java?rev=1502840&r1=1502839&r2=1502840&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/DisabledListDelimiterHandler.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/DisabledListDelimiterHandler.java
Sat Jul 13 19:22:08 2013
@@ -44,6 +44,14 @@ import java.util.List;
 public class DisabledListDelimiterHandler extends AbstractListDelimiterHandler
 {
     /**
+     * A default instance of this class. Because it is safe to share
+     * {@code DisabledListDelimiterHandler} objects this instance can be used
+     * whenever such an object is needed.
+     */
+    public static final ListDelimiterHandler INSTANCE =
+            new DisabledListDelimiterHandler();
+
+    /**
      * {@inheritDoc} This implementation always throws an
      * {@code UnsupportedOperationException} exception.
      */



Mime
View raw message