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;
 
     }


Reply via email to