Friday, November 30, 2012

Looks like a GWT compiler and/or GIN error.

I've got a class, TestPlace, that derives from Place that takes two parameters, both Strings.

I use GIN so I have a PlaceFactory to create instances of my places.  It has a method for creating TestPlace that has two String parameters.

It all looks pretty straight forward, except that inside the TestPlace constructor, both strings end up being the first parameter in the call to the factory method!

Here's the TestPlace constructor:
public TestPlace (@Assisted String testId, @Assisted String authType) {
logger.fine("testId: " + testId+ "; authType: " + authType);
this.testId= testId;
this.authType = authType;
It has the @Inject and @Assisted annotations, as you would expect.

The method signature in the PlaceFactory interface looks like this:
TestPlace createTestPlace(String testId, String authType);
Everything looks pretty normal so far.  However, the log shows that the createTestPlace caller is calling with two different strings, but inside the TestPlace constructor, the strings are identical.

When createTestPlace is compiled to JavaScript, it looks like this:
function $createTestPlace(p0){
  var result;
  result = new TestPlace_0(p0, p0);
  return result;
Notice how it has just one parameter, which it uses twice when calling the TestPlace constructor.

Similarly, the JavaScript call to createTestPlace only has the first parameter.  The second parameter, which is clearly there in the Java, is missing the JavaScript.

Anyone have any ideas what's going on here?

Started seeing this in GWT 2.4. Tonight I upgraded to 2.5 but the problem is still there.  Also using gin-1.5-post-gwt-2.2.jar.

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment