Re: [jxpath] patch for MethodLookupUtils.lookupStaticMethod
joern turner <[email protected]>
| Newsgroups | gmane.comp.jakarta.commons.user,gmane.text.xml.commons.devel |
|---|---|
| Message-ID | <[email protected]> |
Dmitri Plotnikov wrote: > Joern, > > I have updated the code to allow null as the argument "parameters". thanks, so i can throw away my patch. Regards, Joern > > - Dmitri > > ----- Original Message ----- > From: "__matthewHawthorne" <[email protected]> > To: "Jakarta Commons Users List" <[email protected]> > Sent: Tuesday, January 13, 2004 9:12 PM > Subject: Re: [jxpath] patch for MethodLookupUtils.lookupStaticMethod > > > >>If you can, create a patch and submit it to Bugzilla. That way, it >>won't get lost in the mix. >> >> >>joern turner wrote: >> >>>hello, >>> >>>found a problem in MethodLookupUtils when defining a custom function >>>with no arguments cause the passed parameter array is null in that case. >>> >>>a simple test for null and providing an empty Class array in this case >>>solves the issue. >>> >>> >>> public static Method lookupStaticMethod( >>> Class targetClass, >>> String name, >>> Object[] parameters) >>> { >>> boolean tryExact = true; >>> >>> Class types[]; >>> if(parameters==null){ >>> types = new Class[0]; >>> }else{ >>> int count = parameters.length; >>> types = new Class[count]; >>> for (int i = 0; i < count; i++) { >>> Object param = parameters[i]; >>> if (param != null) { >>> types[i] = param.getClass(); >>> } >>> else { >>> types[i] = null; >>> tryExact = false; >>> } >>> } >>> } >>> .... >>> >>>Regards, >>> >>>Joern Turner >> >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: [email protected] >>For additional commands, e-mail: [email protected] >> >> >> >> > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >