groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Russel Winder <rus...@winder.org.uk>
Subject Re: Super Confused About Java vs Groovy Date() and deprecation
Date Sun, 10 Jan 2016 18:31:14 GMT
On Sat, 2016-01-09 at 23:41 -0500, Gerald Wiltse wrote:
> 
[…]
> Apparently, Java Date() is ancient, disliked, and now a bunch of the
> fundamental Java Date() stuff is all "deprecated".  Fortunately,
> Groovys
> new Date().parse(string,string) constructor still works for me.  But,
> everything I try to do with my date object now says deprectated.  It
> gives
> me all the good code completion, and shows that it's suggesting
> Groovy
> methods, but when I implement it puts a strikethrough, and says of
> course...
[…]

Given the way that Java never actually removes anything labelled
deprecated, we have to redefine "deprecated" to be a label that says
"never use this, not even if someone tells you to".

The whole of the original Date and Calendar system in Java should be
deleted (*), but it cannot be. But it should never be used for new
code. JSR310 is not perfect, but it is so far ahead of the old stuff
that no programmer working on the JVM should use anything else.

Groovy should remove the whole Date mess, and especially all the added
extensions trying to patch the mess up. But it can't. Back to JSR310.

Use JDK8+ and the package java.time.


(*) Gosling has apologized for the whole mess, but I cannot find a
reference via Google just now.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder@ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder


Mime
View raw message