[threeten-dev] [threeten-develop] Integration with other JDK classes

Lance Andersen - Oracle Lance.Andersen at oracle.com
Wed Dec 5 07:02:56 PST 2012


On Dec 5, 2012, at 9:46 AM, Stephen Colebourne wrote:

> The question is to what degree should existing JDK date/time classes
> support integration with 310?
> Key open question to everyone is how much integration should be done?
> 
> Here is my list and proposls:
> util.Date - implement DateTimeAccessor (INSTANT_SECONDS and fractional
> second fields)
> sql.Date - implement DateTimeAccessor (EPOCH_DAY and related)
> sql.Time - implement DateTimeAccessor (NANO_OF_DAY and related)
> sql.Timestamp - implement DateTimeAccessor (all ChronoField)


I have not looked at this interface enough to see the amount of work this would require.  This would also require new JCK tests which I had not planned for.


> Calendar - implement DateTimeAccessor (all ChronoField)
> GregorianCalendar - implement DateTimeAccessor (all ChronoField and zone)
> FileTime should implement DateTimeAccessor
> xml.XMLGregorianCalendar should implement DateTimeAccessor
> xml.Duration should implement PlusAdjuster and MinusAdjuster
> TimeUnit should implement PeriodUnit
> 
> In addition, some common additional methods would be very helpful:
> Date.toInstant()
> util.Date.from(DateTimeAccessor)
> sql.Date.from(DateTimeAccessor)
> sql.Time.from(DateTimeAccessor)
> sql.Timestamp.from(DateTimeAccessor)

Same comment as above.  I will talk with Roger and Sherman to see if they have cycles and then I can propose to the JDBC EG
> Calendar.toInstant()
> Calendar.from(DateTimeAccessor)
> GregorianCalendar.toZonedDateTime()
> GregorianCalendar.from(DateTimeAccessor)
> 
> GregorianCalendar might beneft from toLocalDate() and toLocalTime().
> 
> The sql subtypes of util.Date are of course troublesome. The JDBC
> group need to advise on whether they consider them effectively
> deprecated or not.

-1

No we cannot deprecate these at this time, too much existing code out there and people will not want the noise from the javadoc or annotation.  These classes have been used since JDBC 1.0 and the better approach is to document
the preferred way going forward

> 
> DAYS in TimeUnit will be different to DAYS in ChronoUnit as it is
> exactly 24 hours.
> 
> I think that is all the JDK date/time classes. I could be wrong...
> 
> Stephen
> (This was a private discussion being made public)
> 
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> _______________________________________________
> threeten-develop mailing list
> threeten-develop at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/threeten-develop

-------------- next part --------------

Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering 
1 Network Drive 
Burlington, MA 01803
Lance.Andersen at oracle.com



More information about the threeten-dev mailing list