groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gerald Wiltse <jerrywil...@gmail.com>
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
decorated.

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...


   - setYear

   @Deprecated <https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html>
   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
present?

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

Thanks again!

Regards,
Jerry


Gerald R. Wiltse
jerrywiltse@gmail.com

Mime
View raw message