FHIR Chat · Proposed change: replace java.util.Date with java.time.* · hapi

Stream: hapi

Topic: Proposed change: replace java.util.Date with java.time.*


view this post on Zulip James Agnew (Mar 01 2022 at 22:06):

Hi All,

As mentioned during the 5.7.0 release webinar, our next release will be a major bump to 6.0.0.

One of the changes being considered as a part of this bump is to replace our use of java.util.Date in the datatype classes for date/dateTime/instant with their respective java.time equivalents. Presumably:

  • date: java.time.LocalDate
  • dateTime / instant: java.time.ZonedDateTime

This would be a breaking change since calling (for example) DateTime#getValue() would start returning a ZonedDateTime and not a Date. Presumably we would include utility method like getValueAsDate() and setValueAsDate(Date).

So I guess the question here is: Are there any objections to this change? Or for that matter do people think this is beneficial enough to warrant the change?

view this post on Zulip Craig McClendon (Mar 01 2022 at 22:29):

It would definitely affect any clients or PlainServer based implementations. It's likely not too difficult to deal with though. Easier than some of the recent Spring updates probably for those of using HAPI in SpringBoot apps.

You could presumably remove half? the pain points if the existing setters were overloaded to accept both types?

view this post on Zulip Oliver Egger (Mar 02 2022 at 07:52):

+1 for the switch, looking forward for java.time ...

view this post on Zulip Patrick Werner (Mar 02 2022 at 10:05):

+1 for the modern dateTime java classes

view this post on Zulip Jens Villadsen (Mar 02 2022 at 12:56):

I second that


Last updated: Apr 12 2022 at 19:14 UTC