You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sk...@apache.org on 2005/02/13 12:16:11 UTC
svn commit: r153618 -
jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/SAXHandler.java
Author: skitching
Date: Sun Feb 13 03:16:08 2005
New Revision: 153618
URL: http://svn.apache.org/viewcvs?view=rev&rev=153618
Log:
Invoke new Context.checkForProblems method at end of a successful parse,
just in case actions have made errors. This will make any bugs in actions
much easier to detect and solve.
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=153617&r2=153618
==============================================================================
--- 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 13 03:16:08 2005
@@ -865,13 +865,24 @@
// And finally for the RuleManager too
ruleManager.finishParse(context);
} catch(DigestionException ex) {
- log.error("finishParse threw exception", ex);
+ log.error("RuleManager.finishParse threw exception", ex);
throw new NestedSAXException(ex);
}
// store the root object so the user can access it
root = context.getRoot();
-
+
+ // This method verifies that no Actions have misbehaved, leaving the
+ // stacks in a bad state or anything. Of course this is called only
+ // after a parse has successfully completed. It's really a debug method
+ // but as it is pretty quick to check things we leave it in at runtime.
+ try {
+ context.checkForProblems();
+ } catch(ParseException ex) {
+ log.error("Context.checkForProblems threw exception", ex);
+ throw new NestedSAXException(ex);
+ }
+
// And now we don't need the context any more, so allow it to be
// reclaimed. Note that in the case where a parse failed, this
// method is never called, so the user is responsible for calling
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org