On 11 nov 2009, at 11 nov, 23:55, John Tamplin wrote:

> Parameter names of interfaces are not stored in the bytecode, so they are now 
> fetched on first request from the actual source.  It sounds like somehow that 
> is failing.
> 
> Can you set a breakpoint on JAbstractMethod.getRealParameterName and walk 
> through it to see what happens?
> 
> -- 
> John A. Tamplin
> Software Engineer (GWT), Google
> 
> 
I just did, here are my results.

The first calls seem to go just fine, from the third call and beyond things go 
bad:

The first call to getRealParameterName() returns the parameter name exactly as 
it should. The call is for the parameter of the following decl.:

  @Update("CREATE TABLE IF NOT EXISTS clickcount ("
      + "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "
      + "clicked INTEGER)")
  void initTable(VoidCallback callback);

The second call to getRealParameterName() also returns the correct parameter 
name, for parameters of this declaration:

  @Update("INSERT INTO clickcount (clicked) VALUES ({when.getTime()})")
  void insertClick(Date when, RowIdListCallback callback);

The third call is referring to parameters of the same method declaration, 
doesn't call fetchRealParameterNames(), all is well and as it should.

However, after this call there are still some method declarations to process, 
which seem to 'skip' calling the method getRealParameterName() for parameters 
of this declaration:

  @Select("SELECT clicked FROM clickcount WHERE id IN ({ids})")
  void getClicksWithIds(Collection<Integer> ids, ListCallback<ClickRow> 
callback);


A little digging reveals that the property JParameter.argNameIsReal is set to 
true early, in a JParameter constructor, while the arg name is "arg0". This 
means that TypeOracleMediator.resolveParameters() gets a CollectMethodData arg 
'methodData' with the wrong value for hasActualArgNames(). The value for 
hasActualArgNames() is only determined in the method 
CollectMethodData.visitLocalVariable().

I tried commenting line #166 of CollectMethodData, this didn't help anything.

So here it is! :-)



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

Reply via email to