Wednesday, February 27, 2013

RequestFactory issue with overloaded setters in domain type

I'm running into an issue where RequestFactory isn't calling the correct setter on the domain object in DevMode and I've not tried it compiled yet. Looking at the code it appears that ReflectiveServiceLayer.getBeanMethod is just picking the first setter it finds based on SET/SET_BUILDER, are only verifying that the method is a setter, and the method name.

I was going to submit an issue for it and see about getting a patch together but thought I'd ask here first to see if I'm missing something.

A more concrete example that I'm running into is that the domain class has something like the following:

DomainClass.java
void setUnit(String unit) { this.unit = unit; }
void setUnit(SomeUnitEnum unit) { this.unit = unit.toString(); }

ProxyInterface.java
void setUnit(String unit);
String getUnit();

when unit is null, the server side RF code is calling the enum version which is causing an NPE.

Anything I'm missing or should just file the issue?

--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment