Saturday, October 3, 2020

Re: Strange GWT-RPC bug upgrading from 2.7 to 2.8+

Thanks Jens, I did what you asked and have the following in the debugger:

Screen Shot 2020-10-03 at 8.11.01 PM.png

Screen Shot 2020-10-03 at 8.11.17 PM.png

What do you make of this?

I don't see any duplicate GWT on the classpath (project is a pretty simple maven setup).

Thanks,
Aaron

On Friday, October 2, 2020 at 4:31:37 AM UTC-7 Jens wrote:
And there you have it... absolutely no idea why it's malfunctioning in this way. Any help is greatly appreciated!

Ok in sourcemaps it looks indeed a bit weird. However there will be additional JS code executed to convert java.lang.Integer into a primitive int which is represented by JS number. That conversion seems to produce undefined.

Please use newest GWT SDK and either launch SuperDevMode or GWT compiler with these additional command line parameters: "-strict -style PRETTY -XmethodNameDisplayMode ABBREVIATED".

When doing so you make sure that no compile issue will be skipped (-strict), your JS code will be more readable (-style PRETTY) and you can more easily search for Java method names in the generated JS code (-XmethodName...). Next you should disable JS Source Maps support in Chrome Dev Tools to see the JS code.
To find the above method you would search the JS for "AbstractSerializationStreamWriter.addString" and should find a JS line that sets a displayName property. Above that line you will find the method implementation.

In the typical case to convert java.lang.Integer to primitive int, GWT should have generated JS that calls the intValue() method of Integer.


If something looks weird you might also want to double check that you do not have multiple versions of GWT in class path. That sometimes happened people when upgrading GWT and also using a bunch of third party libraries. Sometimes 3rd party libraries also emulate JRE classes which then do not match the JRE emulation in GWT SDK. This can be an additional possibility for unexpected JS behavior.


-- J.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/2dd329d8-b659-46d9-a8e2-13fb704f9656n%40googlegroups.com.

No comments:

Post a Comment