support for JSR 310 / java.time created

968 views
Skip to first unread message

Jörg Hohwiller

unread,
Nov 25, 2013, 7:01:59 PM11/25/13
to google-web-tool...@googlegroups.com
Hi there,
I posted in GWT community on g+ about my JSR 310 backport I created and my super-sourced GWT code.
Stephen Habermann posted:
  Wow, 13000 passing tests is amazing. Great work!  You should post about your progress on the gwt-contrib list

(I am still unsure about when to post to groups and when g+)

So here I am. You can find all my work and changes from here:
https://github.com/m-m-m/mmm/issues/83

I am looking forward for your feedback and discussion. It will be my pleasure to contribute my work to the GWT project.
However, I am not clear about the permissions required from the original authors of threeten since I simply forked their codebase and keept their headers and copyrights in my project.
For GWT this has to be transferred and I assume we would need permissions from Stephen Colebourne, Michael Santos and all the others.

I could not find an issue in GWT tracker for the java.time support. Shall I create one?

Cheers
  Jörg

Jens

unread,
Nov 26, 2013, 4:35:10 AM11/26/13
to google-web-tool...@googlegroups.com
Great work!

Good to know that you are already that far ahead. I had already looked at the source of java.time but did not find the time to start porting it to GWT. But from what I have seen in the java.time code base it seems pretty straight forward to make it GWT compatible except maybe for the ZoneRulesProvider.

If you want us to review it I think its best if you checkout GWT source, create a local branch, apply your java.time stuff on it and then push a single commit to gwt-review.googlesource.com (http://www.gwtproject.org/makinggwtbetter.html). Also if you copy the code from Java 8 (which might or might not be the same as the latest JSR 310 code) there should not be any permission issues as it's part of the JRE.

If you need any help pushing to gwt-review.googlesource.com let us know. Before pushing it to gwt-review it would be nice if you create an issue for it for traceability.

-- J.

John A. Tamplin

unread,
Nov 26, 2013, 7:18:43 AM11/26/13
to Google Web Toolkit Contributors
On Mon, Nov 25, 2013 at 7:01 PM, Jörg Hohwiller <joerg.h...@googlemail.com> wrote:
Hi there,
I posted in GWT community on g+ about my JSR 310 backport I created and my super-sourced GWT code.
Stephen Habermann posted:
  Wow, 13000 passing tests is amazing. Great work!  You should post about your progress on the gwt-contrib list

(I am still unsure about when to post to groups and when g+)

So here I am. You can find all my work and changes from here:
https://github.com/m-m-m/mmm/issues/83

I am looking forward for your feedback and discussion. It will be my pleasure to contribute my work to the GWT project.
However, I am not clear about the permissions required from the original authors of threeten since I simply forked their codebase and keept their headers and copyrights in my project.
For GWT this has to be transferred and I assume we would need permissions from Stephen Colebourne, Michael Santos and all the others.

The BSD-licensed parts shouldn't be any problem to import, but you have a few files with Oracle licenses which aren't going to work.

Also, the GWT i18n code will need to be updated to support this as well.

There are a few things which are going to be very hard to support   As Jens mentioned, ZoneRulesProvider needs an async API so it can fetch the necessary data from a server, so we can't provide a compatible API.  We can provide a GWT-specific version (under a different package), so shared code can deal with ZoneRules/etc but getting them will be different in client vs server code.

Have you looked at generated code size?  There are also a few places where it appears to rely on overflow behavior, which isn't guaranteed in GWT as an int is actually represented by a JS Number under the hood.

--
John A. Tamplin

John A. Tamplin

unread,
Nov 26, 2013, 7:20:34 AM11/26/13
to Google Web Toolkit Contributors
On Tue, Nov 26, 2013 at 4:35 AM, Jens <jens.ne...@gmail.com> wrote:
Also if you copy the code from Java 8 (which might or might not be the same as the latest JSR 310 code) there should not be any permission issues as it's part of the JRE.

I do not believe this is correct - I am pretty sure Oracle's license is incompatible with Apache2 by design.  In general GWT does not use any JRE code from Oracle, and instead uses code from Harmony or implements it from scratch. 

--
John A. Tamplin

Jens

unread,
Nov 26, 2013, 7:47:06 AM11/26/13
to google-web-tool...@googlegroups.com
I do not believe this is correct - I am pretty sure Oracle's license is incompatible with Apache2 by design.  In general GWT does not use any JRE code from Oracle, and instead uses code from Harmony or implements it from scratch. 

Interesting. Glad I am not a lawyer but I am just curious how GWT deals with code that is so easy that you can not implement it differently than Oracle when super sourcing it. Removing/changing JavaDoc is probably not enough to justify changing the license header from x to Google? For example take Cloneable, ClassCastException and similar simple classes/interfaces.

-- J.

John A. Tamplin

unread,
Nov 26, 2013, 8:39:02 AM11/26/13
to Google Web Toolkit Contributors
On Tue, Nov 26, 2013 at 7:47 AM, Jens <jens.ne...@gmail.com> wrote:
I do not believe this is correct - I am pretty sure Oracle's license is incompatible with Apache2 by design.  In general GWT does not use any JRE code from Oracle, and instead uses code from Harmony or implements it from scratch. 

Interesting. Glad I am not a lawyer but I am just curious how GWT deals with code that is so easy that you can not implement it differently than Oracle when super sourcing it. Removing/changing JavaDoc is probably not enough to justify changing the license header from x to Google? For example take Cloneable, ClassCastException and similar simple classes/interfaces.

IANAL, but my understanding is the API is public so you can always reimplement the API - you just can't use their copyrighted code to do so.  The simplicity of the implementation doesn't matter, it is whether you used their source or not.  If there is only one reasonable way to implement something, it is harder to show that you copied their code, but if it is 1000 lines of complex code the odds that it would be essentially the same if you didn't copy it are very slim.

--
John A. Tamplin

Thomas Broyer

unread,
Nov 26, 2013, 8:53:06 AM11/26/13
to google-web-tool...@googlegroups.com
There's https://code.google.com/p/google-web-toolkit/issues/detail?id=603 already. We'd just change the title to read "Emulate javax.time (JSR310)" then.

Thomas Broyer

unread,
Nov 26, 2013, 8:56:04 AM11/26/13
to google-web-tool...@googlegroups.com


On Tuesday, November 26, 2013 1:47:06 PM UTC+1, Jens wrote:
I do not believe this is correct - I am pretty sure Oracle's license is incompatible with Apache2 by design.  In general GWT does not use any JRE code from Oracle, and instead uses code from Harmony or implements it from scratch.

IANAL but code from https://github.com/ThreeTen/threeten had a liberal license IIUC.
 
Interesting. Glad I am not a lawyer but I am just curious how GWT deals with code that is so easy that you can not implement it differently than Oracle when super sourcing it. Removing/changing JavaDoc is probably not enough to justify changing the license header from x to Google? For example take Cloneable, ClassCastException and similar simple classes/interfaces.

Remember the Oracle/Google case about Android vs. Java? Redux: APIs are not copyrightable and "obvious implementations" are not an issue. 

Jörg Hohwiller

unread,
Nov 28, 2013, 8:03:19 PM11/28/13
to google-web-tool...@googlegroups.com

John A. Tamplin:
 
There are a few things which are going to be very hard to support   As Jens mentioned, ZoneRulesProvider needs an async API so it can fetch the necessary data from a server, so we can't provide a compatible API.  We can provide a GWT-specific version (under a different package), so shared code can deal with ZoneRules/etc but getting them will be different in client vs server code.

I simply removed the support for zone rules as well as for DateTimeFormatter[Builder], the global calendar stuff (Hijrah, Japanese, Minguo and ThaiBuddhist) and the custom Java serialization stuff. If someone wants to rewrite this for GWT please join in.
The most important uses cases for me are to be able to deal with Instant, LocalDate, LocalTime, LocalDateTime, OffsetDateTime, OffsetTime, OffsetDate and transfer it between client and server. Further ISO input and output is required (e.g. for HTML5 date/time widgets that produce ISO8601).
Also I (removed) the global calendar stuff for GWT. All the features I have removed are really hard to build with GWT and might overload the client. Such features should either be available natively via JS or not at all. IMHO this is why GWT never supported java.util.Calendar.

So my approach is a pragmatic one with focus on making things happen for the main features. Who really needs time-zone transformation in a web-client? Typically a date, time or date/time
 

Have you looked at generated code size?  There are also a few places where it appears to rely on overflow behavior, which isn't guaranteed in GWT as an int is actually represented by a JS Number under the hood.


Not yet. I will have a look in the next future. What would be the best way. Write a simple entry point that prints current date and time and parses some example date/time strings?

However, I am an open source developer and spend all my nights for pleasure of development. My focus is on a project that should add value to me some day. To do that I am working on a web framework that is based on GWT. Therefore I wrote various HTML5 and other widgets I missed in GWT. For the new HTML5 date/time widgets I wanted to have reasonable data objects and these are neither String nor java.util.Date. So I found java.time and wanted to use this in GWT. It is working for me now. I will do some further support here, but do not expect me to be the man leading this to perfection in GWT 4.0.

Cheers
  Jörg

Jörg Hohwiller

unread,
Dec 9, 2013, 4:20:54 PM12/9/13
to google-web-tool...@googlegroups.com

Daniel Kurka

unread,
Mar 5, 2014, 5:41:59 PM3/5/14
to google-web-tool...@googlegroups.com
@Joerg could you start setting up a patch for review in gerrit?



On Monday, December 9, 2013 10:20:54 PM UTC+1, Jörg Hohwiller wrote:

Salvador Diaz

unread,
Jan 19, 2015, 5:44:00 AM1/19/15
to google-web-tool...@googlegroups.com
For those looking for the code, I found it was moved to an independent project, which I'm hoping should make it easier to integrate in the patch submission process:

I'm willing to take some time to move this forward, either working with Jörg or alone, could anyone walk me through the steps needed to make it happen ?

Colin Alworth

unread,
Jan 19, 2015, 11:01:43 AM1/19/15
to google-web-tool...@googlegroups.com
Are you planning on being at either GWT.create event? I know several people (including myself) who will be there and would be happy to help.

Otherwise, there are several contributors in ##gwt on irc.freenode.net who would be able to help with this process.
--
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/42c41c35-0d05-4448-91f3-e2e0cc685f44%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Salvador Diaz

unread,
Jan 23, 2015, 3:00:17 AM1/23/15
to google-web-tool...@googlegroups.com
I'll be attending GWT.create in Munich, and I'll join ##gwt on freenode. 

On Monday, January 19, 2015 at 5:01:43 PM UTC+1, Colin Alworth wrote:
Are you planning on being at either GWT.create event? I know several people (including myself) who will be there and would be happy to help.

Otherwise, there are several contributors in ##gwt on irc.freenode.net who would be able to help with this process.
On Mon Jan 19 2015 at 4:44:01 AM Salvador Diaz <diaz.s...@gmail.com> wrote:
For those looking for the code, I found it was moved to an independent project, which I'm hoping should make it easier to integrate in the patch submission process:

I'm willing to take some time to move this forward, either working with Jörg or alone, could anyone walk me through the steps needed to make it happen ?


On Wednesday, March 5, 2014 at 11:41:59 PM UTC+1, Daniel Kurka wrote:
@Joerg could you start setting up a patch for review in gerrit?



On Monday, December 9, 2013 10:20:54 PM UTC+1, Jörg Hohwiller wrote:

--
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscribe@googlegroups.com.

Joel Handwell

unread,
May 19, 2015, 11:00:53 AM5/19/15
to google-web-tool...@googlegroups.com
What would be the status of patch?
Was it created or still not read?
Reply all
Reply to author
Forward
0 new messages