简体   繁体   中英

Finding Java classes and/or methods unsupported by GWT

I want to use a third-party library, for which I have the source code, in my GWT project.

Right now, it's failing with the well-known "No source code is available for type...; did you forget to inherit a required module" message. I understand that error to be caused by the dependence of the third-party library on a class/method that is not emulated by GWT.

I'm in a pickle because the GWT compiler does not inform me which class/method in the third-party library is causing it to barf. I kind of expected that a lint-like tool for finding unsupported Java constructs would be included in Google's GWT downloads, but I can't find it.

Any suggestions?

In general, if the library doesn't specify to be GWT-compliant, I wouldn't use it. GWT has some black holes that make sense, because the browser is totally different compared to the JVM.

I don't know of any tool to check which class is not GWT-compliant, but I think that you could do it using JDepend . The idea is to run JDepend specifying the classes that can be used: the emulated JRE classes plus other GWT libraries that you use.

如果代码不依赖于不兼容的类,您可以为库编写自己的.gwt.xml文件,并在您自己的.gwt.xml文件中继承该文件。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM