commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skitch...@apache.org
Subject svn commit: r151563 - jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/SAXHandler.java
Date Sun, 06 Feb 2005 10:01:09 GMT
Author: skitching
Date: Sun Feb  6 02:01:08 2005
New Revision: 151563

URL: http://svn.apache.org/viewcvs?view=rev&rev=151563
Log:
Fix bug where ruleManager might be accessed before being created.

Modified:
    jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/SAXHandler.java

Modified: jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/SAXHandler.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/SAXHandler.java?view=diff&r1=151562&r2=151563
==============================================================================
--- jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/SAXHandler.java
(original)
+++ jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/SAXHandler.java
Sun Feb  6 02:01:08 2005
@@ -654,7 +654,7 @@
      */
     public void addRule(String pattern, Action action)
     throws InvalidRuleException {
-        ruleManager.addRule(pattern, action);
+        getRuleManager().addRule(pattern, action);
     }
 
     /**
@@ -885,7 +885,10 @@
         configure();
 
         try {
-            ruleManager.startParse(context);
+            // This also has the side-effect of creating a RuleManager if
+            // one has not been created before. Of course this would only
+            // happen if no rules had ever been added...
+            getRuleManager().startParse(context);
         } catch(DigestionException ex) {
             throw new NestedSAXException(ex);
         }
@@ -1132,6 +1135,8 @@
         // Fire "begin" events for all relevant rules
         List actions;
         try {
+            // NB: don't need getRuleManager here, as we know it was
+            // created at startDocument if not before..
             actions = ruleManager.getMatchingActions(matchPath);
         } catch(DigestionException ex) {
             throw new NestedSAXException(ex);



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message