commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1067105 - /commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java
Date Fri, 04 Feb 2011 07:51:18 GMT
Author: simonetripodi
Date: Fri Feb  4 07:51:17 2011
New Revision: 1067105

URL: http://svn.apache.org/viewvc?rev=1067105&view=rev
Log:
setup for callMethod() paramTypes[] according to proper CallMethodRule

Modified:
    commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java?rev=1067105&r1=1067104&r2=1067105&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java
(original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java
Fri Feb  4 07:51:17 2011
@@ -577,13 +577,28 @@ final class RulesBinderImpl implements R
 
                     private int targetOffset;
 
-                    private int paramCount;
+                    private int paramCount = 0;
 
                     private Class<?>[] paramTypes;
 
-                    private boolean useExactMatch;
+                    private boolean useExactMatch = false;
 
                     public CallMethodRule get() {
+                        Class<?>[] paramTypes = null;
+
+                        if (this.paramTypes == null) {
+                            if (this.paramCount == 0) {
+                                paramTypes = new Class<?>[] { String.class };
+                            } else {
+                                paramTypes = new Class<?>[this.paramCount];
+                                for (int i = 0; i < paramTypes.length; i++) {
+                                    paramTypes[i] = String.class;
+                                }
+                            }
+                        } else {
+                            paramTypes = this.paramTypes;
+                        }
+
                         return setNamespaceAndReturn(
                                 new CallMethodRule(targetOffset, methodName, paramCount,
paramTypes, useExactMatch));
                     }



Mime
View raw message