commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1295947 - /commons/proper/chain/trunk/configuration/src/main/java/org/apache/commons/chain2/config/ConfigParser.java
Date Thu, 01 Mar 2012 22:25:42 GMT
Author: simonetripodi
Date: Thu Mar  1 22:25:42 2012
New Revision: 1295947

URL: http://svn.apache.org/viewvc?rev=1295947&view=rev
Log:
reuse of the same Digester instance is discouraged, since it is not thread safe

Modified:
    commons/proper/chain/trunk/configuration/src/main/java/org/apache/commons/chain2/config/ConfigParser.java

Modified: commons/proper/chain/trunk/configuration/src/main/java/org/apache/commons/chain2/config/ConfigParser.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/configuration/src/main/java/org/apache/commons/chain2/config/ConfigParser.java?rev=1295947&r1=1295946&r2=1295947&view=diff
==============================================================================
--- commons/proper/chain/trunk/configuration/src/main/java/org/apache/commons/chain2/config/ConfigParser.java
(original)
+++ commons/proper/chain/trunk/configuration/src/main/java/org/apache/commons/chain2/config/ConfigParser.java
Thu Mar  1 22:25:42 2012
@@ -44,12 +44,6 @@ public class ConfigParser {
 
 
     /**
-     * <p>The <code>Digester</code> to be used for parsing.</p>
-     */
-    private Digester digester = null;
-
-
-    /**
      * <p>The <code>RuleSet</code> to be used for configuring our Digester
      * parsing rules.</p>
      */
@@ -72,14 +66,12 @@ public class ConfigParser {
      */
     public Digester getDigester() {
 
-        if (digester == null) {
-            digester = new Digester();
-            RuleSet ruleSet = getRuleSet();
-            digester.setNamespaceAware(ruleSet.getNamespaceURI() != null);
-            digester.setUseContextClassLoader(getUseContextClassLoader());
-            digester.setValidating(false);
-            digester.addRuleSet(ruleSet);
-        }
+        Digester digester = new Digester();
+        RuleSet ruleSet = getRuleSet();
+        digester.setNamespaceAware(ruleSet.getNamespaceURI() != null);
+        digester.setUseContextClassLoader(getUseContextClassLoader());
+        digester.setValidating(false);
+        digester.addRuleSet(ruleSet);
         return (digester);
 
     }
@@ -108,7 +100,6 @@ public class ConfigParser {
      */
     public void setRuleSet(RuleSet ruleSet) {
 
-        this.digester = null;
         this.ruleSet = ruleSet;
 
     }



Mime
View raw message