java - GWT deferred binding not working after compilation -


i trying implement deferred binding using generators. when testing deferred binding in dev mode works expected, when switching production deferred binding not working reason. have following classes

public class generatortest implements entrypoint {      //should modified generator     public static class generatortestprefs extends preferencesimpl { ...     } ... }  public class preferencesimpl implements preferences { ... }  public interface preferences {      public void load(string key, storage storage);      public void store(string key, storage storage); } 

and following definition in gwt module.xml

<generate-with class="com.xxx.xxx.gwt.generator.server.preferencesgenerator">     <when-type-assignable class="com.xxx.xxx.gwt.generator.client.preferences"/> </generate-with> 

i added log classes created

generatortestprefs prefs = gwt.create(generatortestprefs.class)  

in case of dev mode, in log file, see gwt is using class created generator (generatortestprefs_preferencesadapter)

[java] info: deferred binding: com.xxx.xxx.gwt.generator.client.generatortestprefs_preferencesadapter 

in case of production mode, in log file, see gwt is not using class created generator (generatortest$generatortestprefs)

wed apr 01 15:48:06 gmt+300 2015 com.xxx.xxx.gwt.generator.client.generatortest info: deferred binding: com.xxx.xxx.gwt.generator.client.generatortest$generatortestprefs 

i have no idea wrong. missing something? doing wrong?

thank in advance!

it invalid implementation in generator. returned null when class generated , because of proper version used on permutations only

public string generate(treelogger logger, .....) ...{     string classname = null;     if (printwriter != null) {         sourcewriter writer = composer.createsourcewriter(ctx, printwriter);         ....         classname = composer.getcreatedclassname();     }     return classname; } 

when changed

    string classname = packagename + "." + simplename; 

it started work expected.


Comments

Popular posts from this blog

tcpdump - How to check if server received packet (acknowledged) -