It is unusual that you are getting different results in dev mode vs prod mode. That said, you are doing some unusual things in your generator.
You should almost never return null from Generator.generate. From the Javadocs:
Code:
/**
* Generate a default constructible subclass of the requested type. The
* generator throws <code>UnableToCompleteException</code> if for any reason
* it cannot provide a substitute class
*
* @return the name of a subclass to substitute for the requested class, or
* return <code>null</code> to cause the requested type itself to be
* used
*
*/
(Emphasis mine)
This means that since you return null, you are saying 'never mind, don't use my generated code after all'.
Combine that with this (note that you are referring to ExampleScreen, not ScreenObject):
Code:
ScreenObject s = GWT.create(ExampleScreen.class);
And you are asking the compiler to *either* build a generated class, *or* if you've already generated a class, go back to ExampleScreen. This is what it is doing, but apparently not what you want.
First, change the instance of ExampleScreen to ScreenObject, which is what I think you meant. Second, never return null from the generate method - always return the string that refers to the generated class. The javadoc for context.tryCreate and other related methods says that it will return null if the file already exists - this only means that you don't need to generate it again, but just use it.
Look at any sample generator in GWT or GXT and you'll see that this is how you are supposed to use generators.
Additional style remark: just as GWT/Java client code usually belongs in the 'client' package, Generator code usually goes in a 'rebind' package. This code isn't run as part of the server, so really doesn't belong in the 'server' package.