commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skitch...@apache.org
Subject svn commit: r378848 - /jakarta/commons/proper/digester/trunk/src/java/org/apache/commons/digester/SetNestedPropertiesRule.java
Date Sun, 19 Feb 2006 04:50:46 GMT
Author: skitching
Date: Sat Feb 18 20:50:45 2006
New Revision: 378848

URL: http://svn.apache.org/viewcvs?rev=378848&view=rev
Log:
Fix for bugzilla#34819. There is one odd situation where AnyChildRules.rules() will
be called, so we can't throw an "unsupported exception" in that case.

Modified:
    jakarta/commons/proper/digester/trunk/src/java/org/apache/commons/digester/SetNestedPropertiesRule.java

Modified: jakarta/commons/proper/digester/trunk/src/java/org/apache/commons/digester/SetNestedPropertiesRule.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/digester/trunk/src/java/org/apache/commons/digester/SetNestedPropertiesRule.java?rev=378848&r1=378847&r2=378848&view=diff
==============================================================================
--- jakarta/commons/proper/digester/trunk/src/java/org/apache/commons/digester/SetNestedPropertiesRule.java
(original)
+++ jakarta/commons/proper/digester/trunk/src/java/org/apache/commons/digester/SetNestedPropertiesRule.java
Sat Feb 18 20:50:45 2006
@@ -351,9 +351,22 @@
         }
         
         public List rules() {
-            // This is not actually expected to be called.
-            throw new RuntimeException(
-                "AnyChildRules.rules not implemented.");
+            // This is not actually expected to be called during normal
+            // processing.
+            //
+            // There is only one known case where this is called; when a rule
+            // returned from AnyChildRules.match is invoked and throws a
+            // SAXException then method Digester.endDocument will be called
+            // without having "uninstalled" the AnyChildRules ionstance. That
+            // method attempts to invoke the "finish" method for every Rule
+            // instance - and thus needs to call rules() on its Rules object,
+            // which is this one. Actually, java 1.5 and 1.6beta2 have a
+            // bug in their xml implementation such that endDocument is not 
+            // called after a SAXException, but other parsers (eg Aelfred)
+            // do call endDocument. Here, we therefore need to return the
+            // rules registered with the underlying Rules object.
+            log.debug("AnyChildRules.rules invoked.");
+            return decoratedRules.rules();
         }
         
         public void init(String prefix, Rules rules) {



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