开发者

In GWT - using existing Java classes in JRE emulation layer

I'm working on porting an existing codebase to GWT, but I am to change as little of the existing Java code as possible since GWT allows us to reuse much of this code from our existing Java app, in out new GWT-based version.

In many places, functionality of our own classes changes dramatically between the Java and GWT implementations, so we put in an interface and implement this separately on the GWT side. The same is true of some Java classes - Locale springs to mind.

Some Java classes that we use (but which do not exist in GWT's JRE emulation library) we have written for ourselves, which has given us the ability to make minor adjustments where needed (Locale was one of these).

However there are a few Java classes which are not present in GWT's JRE emulation layer, but would compile with absolutely no problems if we were to put them there (ie copy and paste the code into our own emulation layer).

I'm trying to read the license, but having no luck in determining - are we permitted to copy the code开发者_高级运维 from say, StringTokenizer, to our own java.util.StringTokenizer.java? Alternatively is there any other way of pulling code such as this into GWT? I see no point in reinventing or rewriting the wheel, but don't want to fall on the wrong side of the license.

Thanks!


Depending on your project you might be able to use source from the OpenJDK as that is GPL licensed.

Each source file is licensed individually so make sure you check thee license of the code you use.


There is a library called GWTx which seems to be an extension of GWTs JRE emulation and contains some of the classes and methods that are not in GWTs JRE emulation library.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜