hmm... i looked and there appears to be a simple fix.

  private static String computeInternalSignature(JMethod method) {
    StringBuffer sb = new StringBuffer();
    sb.setLength(0);
    sb.append(method.getName());
    JParameter[] params = method.getParameters();
    int i = 0;
    for (JParameter param : params) {
      sb.append("/");
      JType paramType = param.getType();
      if (i++ == params.length - 1) {
            paramType = getAsyncCallbackSignature(paramType);
      }
      sb.append(paramType.getErasedType().getQualifiedSourceName());
    }
    return sb.toString();
  }

getAsyncCallbackSignature simply checks to see if there's a way to
cast the paramType to AsyncCallback.  If there is, then it returns the
equivalent AsyncCallback JType.  If there isn't, it returns the
original JType.

Haven't looked at the JType API to see how getAsyncCallbackSignature
would be written.  I'll try to look at it Tuesday evening when I have
some time.

On Fri, Mar 27, 2009 at 2:10 PM, Scott Blum <[email protected]> wrote:
>
> I'm sure it's unintentional.  Here's where you would go to fix it:
> http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/user/rebind/rpc/RemoteServiceAsyncValidator.java#185
>
> On Fri, Mar 27, 2009 at 2:00 PM, Vitali Lovich <[email protected]> wrote:
>>
>> I tried to use my own custom class that extends AsyncCallback in the async 
>> interface, & the compiler told me that the async version didn't match the 
>> sync version.
>>
>> For instance:  public interface NoResultCallback extends 
>> AsyncCallback<Void>.  It's not really an issue, but I prefer to use the more 
>> precise type to get the compiler to statically check the code.
>>
>> Is this by design for a reason?
>>
>
>
> >

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to