I think I am bitten by the same bug here.

This piece of code of my Generator:

    sw.print("public final void " + service.getName() + "(");
    for (int i = 0; i < params.length; i++) {
      if (i > 0) {
        sw.print(", ");
      }
      sw.print("final " + genUtils.getClassName(params[i].getType()) + " "
          + params[i].getName());
    }
    sw.println(") {");

creates a method declaration like:

    public final void serviceName(final int a, final String b) {

since about the same time yesterday my generator outputs this declaration:

    public final void serviceName(final int arg0, final String arg1) {

and dropped the original name (a, b), which are used in annotations, so they 
*must* be the same. It seems JParameter.getName() fails to return the 'real' 
name of the parameter!

Test to reproduce:

1) Check out this SVN repo: 
http://gwt-mobile-webkit.googlecode.com/svn/trunk/gwt-mobile-webkit/database/
2) hit 'ant' on the cmdline
3) watch the compiler errors. Look at source 
[database]/build/out/samples/HelloDatabase/.gwt-gen/com/google/code/gwt/database/sample/hellodatabase/client/ClickCountDataService_SqlProxy.java
 which is generated with 
http://gwt-mobile-webkit.googlecode.com/svn/trunk/gwt-mobile-webkit/database/samples/hellodatabase/src/com/google/code/gwt/database/sample/hellodatabase/client/ClickCountDataService.java
 as source.

Bart Guijt
E: [email protected]
T: +31 6 30408987

On 10 nov 2009, at 10 nov, 23:02, John Tamplin wrote:

> On Tue, Nov 10, 2009 at 4:47 PM, aris <[email protected]> wrote:
> I just recompiled from SVN and now I get this error, but it doesn't
> say where in my code is the problem... is there anything I could try?
> 
> Somehow there is a class which was detected as a local or inner class that 
> does not actually have a synthetic constructor parameter for the containing 
> class -- this would almost certainly be a bug in the recently added code to 
> build TypeOracle from bytecode rather than JDT parse trees.
> 
> The easiest way to do this would be to add at line 60 in 
> CollectMethodData.java the following:
> if (argTypes.length < 1) {
>   throw new IllegalStateException("Missing synthetic argument to 
> constructor");
> }
> and set a breakpoint on the throw.  When you hit it, go up the callstack to 
> CollectClassData and see what the value of name is there -- that will give 
> you the class which is causing the problem.
> 
> To fix it, I will probably need the source and bytecode (or the source for 
> the transitive dependencies so I could build it).  If that is acceptable, I 
> can get you a patch to dump the bytecode to disk.  If you can't share the 
> code, perhaps you could distill a minimal test case that triggers the bug 
> that you could send.  Please reply off-list to make arrangements.
> 
> -- 
> John A. Tamplin
> Software Engineer (GWT), Google
> 
> > 


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

Reply via email to