Skip to main content

[jsr339-experts] Re: [jax-rs-spec users] Re: Re: InvocationCallback changing?

  • From: Bill Burke <bburke@...>
  • To: jsr339-experts@...
  • Subject: [jsr339-experts] Re: [jax-rs-spec users] Re: Re: InvocationCallback changing?
  • Date: Thu, 28 Jun 2012 19:33:36 -0400



On 6/28/12 4:19 PM, Bill Burke wrote:

I guess I've exhausted my arguments.  I hope somebody else chimes in here.


Well, I haven't exhausted yet. Are you sure your new abstract class implementation works? I still think you have type erasure with your solution. To test my theory I tried this:

public class TestIt
{
public static abstract class MyInvocationCallback<T> extends GenericType<T>
   {
      public abstract void complete(T value);
   }

public static class GenericInvocationCallback<T> extends MyInvocationCallback<T>
   {
      @Override
      public void complete(T value)
      {
      }
   }

   public static void main(String[] args) throws Exception
   {
GenericInvocationCallback<List<String>> callback = new GenericInvocationCallback<List<String>>();

      System.out.println(callback.getRawType().getName());
   }
}


And it failed with an IllegalArgumentException

Exception in thread "main" java.lang.IllegalArgumentException: org.jboss.resteasy.core.ServerResponse.org.jboss.resteasy.core.ServerResponse$MyInvocationCallback<T> does not specify the type parameter T of GenericType<T>
        at javax.ws.rs.core.GenericType.getTypeArgument(GenericType.java:245)
        at javax.ws.rs.core.GenericType.<init>(GenericType.java:117)
at org.jboss.resteasy.core.ServerResponse$MyInvocationCallback.<init>(ServerResponse.java:496)
at org.jboss.resteasy.core.ServerResponse$GenericInvocationCallback.<init>(ServerResponse.java:501)
        at 
org.jboss.resteasy.core.ServerResponse.main(ServerResponse.java:511)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at 
com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)



--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com




[jsr339-experts] InvocationCallback changing?

Bill Burke 06/26/2012

[jsr339-experts] Re: InvocationCallback changing?

Marek Potociar 06/27/2012

[jsr339-experts] Re: InvocationCallback changing?

Bill Burke 06/27/2012

[jsr339-experts] Re: InvocationCallback changing?

Bill Burke 06/27/2012

[jsr339-experts] Re: [jax-rs-spec users] Re: InvocationCallback changing?

Marek Potociar 06/28/2012

[jsr339-experts] Re: [jax-rs-spec users] Re: InvocationCallback changing?

Bill Burke 06/28/2012

[jsr339-experts] Re: [jax-rs-spec users] Re: Re: InvocationCallback changing?

Marek Potociar 06/28/2012

[jsr339-experts] Re: [jax-rs-spec users] Re: Re: InvocationCallback changing?

Bill Burke 06/28/2012

[jsr339-experts] Re: [jax-rs-spec users] Re: Re: InvocationCallback changing?

Bill Burke 06/28/2012
 
 
Close
loading
Please Confirm
Close