4 ms·
There's no need for Joda for datetime with Java 8 as it has sane (immutable!) classes inspired by Joda. And as all prior versions of Java are EOL there's no re
by koolba 10y ago
There's no need for Joda for datetime with Java 8 as it has sane (immutable!) classes inspired by Joda.
And as all prior versions of Java are EOL there's no reason not to be using Java 8.
- CydeWeys 10y agoJava 8 isn't supported quite yet on App Engine :-( Support is in beta, and should hopefully be available "for real" within months, but until it is, we're stuck with the old stuff. I also wonder what kind of data migration we'll be facing, since all of our persisted data is from Joda DateTimes, not Java 8 ones. Hopefully none.
- niftich 10y agoIf your datetime is persisted ISO 8601 form, RFC 3339 form, some other unambiguously parseable string form, in epoch form, or as some database-native reliable datetime type, you'll be fine. But if by any chance it's Java-serialized Joda-Time objects, you're going to want to get them out of that form, as the Java-serialized forms are not compatible.
- koolba 10y agoIf you're data is persisted in Java-serialized form you should be fired. That's not just for just dates or timestamps either. That's for data period.
- CydeWeys 10y agoLooks like our native representation in Datastore is java.util.Date, so we should be in the clear. Relevant code here: https://github.com/google/nomulus/blob/master/java/google/registry/model/translators/ReadableInstantUtcTranslatorFactory.java https://github.com/google/nomulus/blob/master/java/google/re...
- shabbyrobe 10y agoCheck out the ThreeTen backport for a mostly API-compatible Java 6/7 version of the Java 8 date API: http://www.threeten.org/threetenbp/ http://www.threeten.org/threetenbp/
- jcrites 10y agoFYI: Java 9 is scheduled for release in July. http://openjdk.java.net/projects/jdk9/ http://openjdk.java.net/projects/jdk9/
- toyg 10y ago> there's no reason not to be using Java 8. I wish. When life (or rather a vendor) gives you java 6 libs which barely work on java 7, you make java7 lemonade.
- koolba 10y agoWhat kind of crappy library doesn't work on a newer version of Java? The only thing I can see breaking would be reflection based invocations of new methods on existing interfaces (ex: Foo has a .bar() in Java 7 but not Java 6). You'd have to be doing something pretty unusual for that to bite you.
- toyg 10y ago> What kind of crappy library doesn't work on a newer version of Java? Oracle middleware libraries (to be fair, mostly acquired)... I believe the problem was that in Java 8, something related to StringBuilder or string parsing was breaking hard. With Java7 it was ok, so we went with that.
- koolba 10y agoAh that's not a compatibility issues so much as a change in performance. I think they changed the defaults for String interning. In the vast majority of cases it's be a performance improvement but if you were manually managing lots of small Strings (ex: custom file processor reading misc user input) then it could get out of control.