tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From schu...@apache.org
Subject svn commit: r1842096 - /tomcat/trunk/java/org/apache/tomcat/util/digester/CallMethodRule.java
Date Thu, 27 Sep 2018 13:45:09 GMT
Author: schultz
Date: Thu Sep 27 13:45:08 2018
New Revision: 1842096

URL: http://svn.apache.org/viewvc?rev=1842096&view=rev
Log:
Allow missing element attributes to produce a null call-parameter value.

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/digester/CallMethodRule.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/digester/CallMethodRule.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/digester/CallMethodRule.java?rev=1842096&r1=1842095&r2=1842096&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/digester/CallMethodRule.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/digester/CallMethodRule.java Thu Sep 27 13:45:08
2018
@@ -317,10 +317,12 @@ public class CallMethodRule extends Rule
         for (int i = 0; i < paramTypes.length; i++) {
             // convert nulls and convert stringy parameters
             // for non-stringy param types
-            if(
-                parameters[i] == null ||
-                 (parameters[i] instanceof String &&
-                   !String.class.isAssignableFrom(paramTypes[i]))) {
+            Object param = parameters[i];
+            // Tolerate null non-primitive values
+            if(null == param && !paramTypes[i].isPrimitive())
+                paramValues[i] = null;
+            else if(param instanceof String &&
+                    !String.class.isAssignableFrom(paramTypes[i])) {
 
                 paramValues[i] =
                         IntrospectionUtils.convert((String) parameters[i], paramTypes[i]);



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


Mime
View raw message