Is there a tool that checks GWT JRE emulation library violations?

[亡魂溺海] 提交于 2020-01-07 04:33:29

问题


I'm trying to port a Swing application to GWT.

However lots of this application classes use things that are not supported by GWT JRE emulation library such as java.util.Locale, java.text.SimpleDateFormat and much more.

Is there a tool that scans a project and spots such problems?


回答1:


The Google Plugin for Eclipse shows errors for things that are unsupported by GWT's JRE emulation. http://code.google.com/eclipse/




回答2:


The GWT compiler will complain if you try to access classes in the JRE that are not supported.




回答3:


My GWT plugin does not warn until the end of a compilation process.

I fixed this issue by the following way.

In eclipse, Create a java project. Remove JRE from class path. Go to gwt-user.jar. Locate java emulation classes. The path is like that: ..super../emul/java/... Copy them to your java project. What we get So far, your Java project without JRE have java.lan. and etc. classes. This will work except com.google.gwt.lang.Array.java will be missing. I created that array class (you can find it from internet, I couldn't locate it inside jars). Add gwt-user and dev jars to the classpath.

Now, your own library can use only gwt java emulation and other gwt classes. Eclipse will automatically warn you if you access a non emulated Java library.



来源:https://stackoverflow.com/questions/1074876/is-there-a-tool-that-checks-gwt-jre-emulation-library-violations

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!