groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gerald Wiltse <>
Subject Super Confused About Java vs Groovy Date() and deprecation
Date Sun, 10 Jan 2016 04:41:57 GMT
I'm sure this is old topic, but I can't find clear answer. IT's about
Date(), but i suppose it's true for anything "Java" which Groovy has

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

   - setYear

   @Deprecated <>
   public void setYear(int year)

   - Deprecated. As of JDK version 1.1, replaced by Calendar.set(Calendar.YEAR,
   year + 1900).

1.  I want to color inside the lines, so should I move toward using all
Calendar objects and methods and completely avoid using Date() on new
projects?  It's no problem, I just don't see that clearly stated anywhere
in the Groovy docs.

2.  OR... are Groovy date methods alive and well and somehow I can tell
eclipse to stop associated with the old Java classes when Groovy ones are

If this is an eclipse only issue, then I'm sorry.

Thanks again!


Gerald R. Wiltse

View raw message