users@jersey.java.net

Re: [Jersey] Changes (fixes?) during wadl improvement

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 18 Jun 2008 11:29:50 +0200

Martin Grotzke wrote:
> 2) The InjectableProviderFactory didn't compile for me because of a
> generics issue:
>
> Index: jersey/src/impl/com/sun/jersey/impl/application/InjectableProviderFactory.java
> ===================================================================
> --- jersey/src/impl/com/sun/jersey/impl/application/InjectableProviderFactory.java (revision 1081)
> +++ jersey/src/impl/com/sun/jersey/impl/application/InjectableProviderFactory.java (working copy)
> @@ -385,7 +385,7 @@
> }
> });
>
> - for (Constructor<T> con : c.getConstructors()) {
> + for (Constructor<?> con : c.getConstructors()) {
> List<Injectable> is = new ArrayList<Injectable>();
> int ps = con.getParameterTypes().length;
> for (int p = 0; p < ps; p++) {
> @@ -400,7 +400,7 @@
> }
> is.add(i);
> }
> - cs.add(new ConstructorInjectablePair<T>(con, is));
> + cs.add(new ConstructorInjectablePair<T>( (Constructor<T>)con, is));
> }
>
> return cs.first();
>
> I'm running 1.6.0_04.
>

That does not compile for 1.5.x.

In 1.5.x:

   public Constructor[] getConstructors()
                               throws SecurityException

In 1.6.x:

   public Constructor<?>[] getConstructors()
                                  throws SecurityException

I fixed it in the trunk a couple of days ago and used the non generic
versions of Constructor.

Paul.

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109