these patches change digester to use beanutils MethodUtil.

this fixes the IllegalAccessException problem in my test harness and 
passes the unit tests on my machine.

- robert

Index: digester/src/java/org/apache/commons/digester/CallMethodRule.java
===================================================================
RCS file: 
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/CallMethodRule.java,v
retrieving revision 1.10
diff -u -r1.10 CallMethodRule.java
--- digester/src/java/org/apache/commons/digester/CallMethodRule.java   2001/11/14 
18:57:01     1.10
+++ digester/src/java/org/apache/commons/digester/CallMethodRule.java   2001/12/11 
+22:19:26
@@ -66,7 +66,9 @@
 import java.lang.reflect.Method;
 import java.lang.ClassLoader;
 import org.xml.sax.Attributes;
+
 import org.apache.commons.beanutils.ConvertUtils;
+import org.apache.commons.beanutils.MethodUtils;
 
 
 /**
@@ -307,8 +309,8 @@
            sb.append(")");
            digester.log(sb.toString());
        }
-       Method method = top.getClass().getMethod(methodName, paramTypes);
-       method.invoke(top, paramValues);
+        
+        MethodUtils.invokeExactMethod(top, methodName, paramValues, paramTypes);
 
     }
 
Index: digester/src/java/org/apache/commons/digester/SetNextRule.java
===================================================================
RCS file: 
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetNextRule.java,v
retrieving revision 1.7
diff -u -r1.7 SetNextRule.java
--- digester/src/java/org/apache/commons/digester/SetNextRule.java      2001/11/14 
18:54:19     1.7
+++ digester/src/java/org/apache/commons/digester/SetNextRule.java      2001/12/11 
+22:19:47
@@ -67,7 +67,9 @@
 import java.lang.reflect.Method;
 import org.xml.sax.Attributes;
 
+import org.apache.commons.beanutils.MethodUtils;
 
+
 /**
  * Rule implementation that calls a method on the (top-1) (parent)
  * object, passing the top object (child) as an argument.  It is
@@ -161,12 +163,12 @@
                 digester.getClassLoader().loadClass(paramType);
         else
            paramTypes[0] = child.getClass();
-       Method method = parent.getClass().getMethod(methodName, paramTypes);
-       method.invoke(parent, new Object[] { child });
+            
+        MethodUtils.invokeExactMethod(parent, methodName, new Object [] {child} , 
+paramTypes );
 
     }
-
 
+ 
     /**
      * Render a printable version of this Rule.
      */
Index: digester/src/java/org/apache/commons/digester/SetTopRule.java
===================================================================
RCS file: 
/home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetTopRule.java,v
retrieving revision 1.7
diff -u -r1.7 SetTopRule.java
--- digester/src/java/org/apache/commons/digester/SetTopRule.java       2001/11/14 
18:54:19     1.7
+++ digester/src/java/org/apache/commons/digester/SetTopRule.java       2001/12/11 
+22:20:11
@@ -67,6 +67,7 @@
 import java.lang.reflect.Method;
 import org.xml.sax.Attributes;
 
+import org.apache.commons.beanutils.MethodUtils;
 
 /**
  * Rule implementation that calls a method on the top (parent)
@@ -160,8 +161,8 @@
                 digester.getClassLoader().loadClass(paramType);
         else
             paramTypes[0] = child.getClass();
-       Method method = parent.getClass().getMethod(methodName, paramTypes);
-       method.invoke(parent, new Object[] { child });
+            
+        MethodUtils.invokeExactMethod(parent, methodName, new Object [] {child} , 
+paramTypes );
 
     }
 


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to