Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 17470 invoked from network); 17 Jan 2004 03:29:26 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 17 Jan 2004 03:29:26 -0000 Received: (qmail 50830 invoked by uid 500); 17 Jan 2004 03:29:00 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 50567 invoked by uid 500); 17 Jan 2004 03:28:59 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 50483 invoked from network); 17 Jan 2004 03:28:58 -0000 Received: from unknown (HELO sccrmhc12.comcast.net) (204.127.202.56) by daedalus.apache.org with SMTP; 17 Jan 2004 03:28:58 -0000 Received: from plotnix2500 (pcp02137893pcs.reston01.va.comcast.net[68.48.26.233]) by comcast.net (sccrmhc12) with SMTP id <2004011703290701200276lpe>; Sat, 17 Jan 2004 03:29:07 +0000 Message-ID: <00aa01c3dcaa$133690c0$0500a8c0@plotnix2500> From: "Dmitri Plotnikov" To: "Jakarta Commons Users List" , "Jakarta Commons Developers List" References: <40049B58.1010602@web.de> <4004A5A7.7060307@phreaker.net> Subject: Re: [jxpath] patch for MethodLookupUtils.lookupStaticMethod Date: Fri, 16 Jan 2004 22:29:11 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Joern, I have updated the code to allow null as the argument "parameters". - Dmitri ----- Original Message ----- From: "__matthewHawthorne" To: "Jakarta Commons Users List" 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: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org