users@jersey.java.net

Re: [Jersey] WADL generator resource loading uses the wrong class loader

From: Martin Grotzke <martin.grotzke_at_freiheit.com>
Date: Fri, 20 Feb 2009 15:37:07 +0100

On Fri, 2009-02-20 at 13:57 +0100, Jakub Podlesak wrote:
> On Fri, Feb 20, 2009 at 01:04:23PM +0100, Paul Sandoz wrote:
> >
> > On Feb 20, 2009, at 11:47 AM, Jakub Podlesak wrote:
> >
> >> On Fri, Feb 20, 2009 at 11:30:49AM +0100, Martin Grotzke wrote:
> >>> Hi Jakub,
> >>>
> >>> I just modified the GenerateWadlMojo so that it creates a more
> >>> informative error message (which property fails).
> >>>
> >>> Can you svn update and build/install the maven-wadl-plugin and try
> >>> again?
> >>
> >> Sure, please see the new output log attached,
> >>
> >
> > The problem is that i think Class.getConstructors() returns an array whose
> > elements are not sorted and not in any particular order (although that is
> > not stated in the JavaDoc, which is stated for returning of methods).
> >
> > The following code should check that the number of parameters is equal to
> > one:
> >
> > private Constructor<?> getMatchingConstructor( final Class<?>
> > paramClazz,
> > final Object propertyValue ) {
> > final Constructor<?>[] constructors = paramClazz.getConstructors();
> > for ( Constructor<?> constructor : constructors ) {
> > final Class<?>[] parameterTypes =
> > constructor.getParameterTypes();
> > if ( parameterTypes.length > 0
>
> changed the above condition to parameterTypes.length == 1
That's it, thanx for fixing this!

Cheers,
Martin


>
> ~Jakub
>
>
> > && constructor.getParameterTypes()[0] ==
> > propertyValue.getClass() ) {
> > return constructor;
> > }
> > }
> > return null;
> > }
> >
> > Paul.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> > For additional commands, e-mail: users-help_at_jersey.dev.java.net
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
-- 
Martin Grotzke
Dipl.-Inf.
freiheit.com technologies gmbh
Straßenbahnring 22 / 20251 Hamburg, Germany
fon       +49 (0)40 / 890584-0
fax       +49 (0)40 / 890584-20
HRB Hamburg 70814
eb0e 645c 9730 c8a3 ee2f  1b9a 5de5 21cb c259 fe34
Geschäftsführer: Claudia Dietze, Stefan Richter, Jörg Kirchhof