-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
All,
I'd like to make a small change to CallMethodRule. Our version/fork of
Digester is quite old, and the current (commons-digester) version
includes something which works similar to the way this patch will work.
### Eclipse Workspace Patch 1.0
#P tomcat-trunk
Index: java/org/apache/tomcat/util/digester/CallMethodRule.java
===================================================================
- --- java/org/apache/tomcat/util/digester/CallMethodRule.java (revision
1842017)
+++ java/org/apache/tomcat/util/digester/CallMethodRule.java (working
copy)
@@ -317,10 +317,12 @@
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]);
Basically, I have added a check for null-values for non-primitive
values, and allow the null value to propagate to the method parameter.
I'd like to make this change as a prerequisite to another, larger
change that relies on this change to tolerate *missing* XML element
attributes.
Please let me know if you have any questions.
Thanks,
- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlur6zYACgkQHPApP6U8
pFjfpQ//T3guBNr9HAFla1rdmizVF36lurNWpB5g9U5pvT6qxtZ0N43jECHJ/KVf
HxzyzOWRx3R5wK6e3rYgPY+VTM19YEqlhxnNFj04fZWXFMrXc/rXc6RsD4gFFEyC
ep9P2Yfglo35Td9BiF4EM/wkzkByhHmLsjKjmiuWpV7oMZneE2IJtjxRqdo2BIkX
4JqDJT0kdmJu/a1EDHPJ51GGs2TuQtqAr/FgxUoKpVEmcWVik30RNS/7YFPHyaXl
95dT8JRa0zw2+ODdXQTX1x/bVDftpAiY210hPcdlWpG5Blso7zhMelZH55nY8c6j
xZFIQ5qvde7pq1w3Iv/CEgR/UyOKNVcno+LvVVRUJE3AfU/v9PAIxMSJCxjqUM/b
b25kxjAAmL7Hi9IoitjThdWjQ2tqoODAKZxbexLRds6KnYPgignxCPAPx5NXuyHH
d9+PPsEvANdR1Ro5XLj5cRIxqZ8vMqnuxjdaiFRZGtfDfNWhCm1JLNMxBaZm8sIz
uhDMnWTvZQknHseYFWjDc2bdqtJUDsdi+Rq0FIlWf6bRkjbu75MTLPH+i4CjPmiV
GQcBdXpM7MfjYGRKDsbfm79uofDycuYqsgqH24UV6SZrZc2cQ8Yh3aFn9VXzBcdC
qAhY7JxcmGdD7haguNupDjwd2aXf2m8u2kbf22mf9j4wuKnmELo=
=IoPV
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]