Tuesday, March 24, 2015

Re: DeobfuscatorBuilder and RequestFactoryGenerator are generating different operation keys for one operation

See https://code.google.com/p/google-web-toolkit/issues/detail?id=6794

On Tuesday, March 24, 2015 at 4:26:12 PM UTC+1, Anton Mityagin wrote:
Hi

Assume we have RequestContext:

@Service(value = MailService.class, locator = ServiceLocator.class)
public interface MailRequest extends ListRequest<MailProxy, String>
{
}

where ListRequest is:

public interface ListRequest<ENTITY, FILTER> extends RequestContext
{
    Request<List<ENTITY>> getList(FILTER filter);
}

key has been generated by DeobfuscatorBuilder is "s2OXmI9MWfbVWEWUqQIsSSy6oPE="

however
key for this method has been generated by RequestFactoryGenerator is
"Otf_2Lug8oJ_wk5ah9u53qNbPF8="

After investigation with debbuger
I've found that
DeobfuscatorBuilder call ctor of OperationKey with such parameters:
requestContextBinaryName - "com.axada.gxt.extension.client.requestfactory.request.MailRequest"
methodName - "getList"
descriptor - "(Ljava/lang/Object;)Lcom/google/web/bindery/requestfactory/shared/Request;"

But RequestFactoryGenerator call ctor of OperationKey with such parameters:
requestContextBinaryName - "com.axada.gxt.extension.client.requestfactory.request.MailRequest"
methodName - "getList"
descriptor - "(Ljava/lang/String;)V"

the difference is in last parameter. more precisely in type of param of method getList
in DeobfuscatorBuilder it is Object (wrong) but in RequestFactoryGenerator it is String (right)

return type of method is ignored by OperationKey class while generation key.

Workaraund is to override this method in MailRequest with concrete type.Then DeobfuscatorBuilder will generate same key as RequestFactoryGenerator  


GWT version is 2.7.0

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment