Comparing ThreeTen backport to JSR-310

我怕爱的太早我们不能终老 提交于 2019-12-04 20:46:29

问题


For some reasons, we can't use java 8 right now - we're still stuck at java 7.
However, I'd like to use the new JSR-310 date/time APIs right now, using the official backport ThreeTen.

Its homepage states:

The backport is NOT an implementation of JSR-310, as that would require 
jumping through lots of unnecessary hoops. Instead, this is a simple backport
intended to allow users to quickly use the JSR-310 API on Java SE 6 and 7.

Questions:

  1. What are your experience with ThreeTen? Are there some drawbacks?

  2. How compatible is this project compared to the official JSR-310 implementations?

  3. How much effort is required to migrate from ThreeTen to an official java 8 implementation?

  4. Is it worth to migrate now to ThreeTen and later to JSR-310 - or should someone wait until java 8 can be used, hencing skipping ThreeTen?


回答1:


See this blog post.

ThreeTen-Backport is a solid backport consisting of equivalent code for the main API (though not so good for non-ISO calendar systems). To convert to Java 8 java.time requires changing the package name, and altering some constants to be method references.

I would not advise migrating from Joda-Time to ThreeTen-Backport, but do advise migrating from Joda-Time to Java 8 java.time.



来源:https://stackoverflow.com/questions/29346649/comparing-threeten-backport-to-jsr-310

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