GWT super dev mode, SimpleCheckBox.wrap() AssertionError

233 views Asked by At

With GWT I had an issue with SimpleCheckBox.wrap() method as it produced the AssertionError in DevMode. And I used to work around that by adding the code that was only being executed if GWT.isScript() is true. I face the same challenge now with SuperDevMode and the question is: is there a method of recognizing superdevmode from the source code during runtime?

Thanks in advance!

P.S. There is no quick way now of getting rid of that .wrap() call from the code so question is really limited to run mode recognition.

Upd. 1:

I created a new "special" class with no .wrap() method and added these lines into my module's gwt.xml file:

<set-property name="superdevmode" value="on"/>
<replace-with class="com.project.client.MyWidgetSuperdevmode">
    <when-type-is class="com.jostleme.jostle.ui.rich.client.MyWidgetProdMode" />
    <when-property-is name="superdevmode" value="on"/>
</replace-with>

And tried multiple things: compiled via bookmark, recompiled project old way, restarted both regular and codeserver apps; and in sourcemaps can only see class MyWidgetProdMode. What am I doing wrong? Will new classes be loaded on compile?

1

There are 1 answers

0
Thomas Broyer On

There's a superdevmode property that you can use in deferred binding rules, but there's otherwise no way similar to isScript() to detect whether you're in superdevmode or not. The property can have value on or off.