groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thibault Kruse <tibokr...@googlemail.com>
Subject Re: Super Confused About Java vs Groovy Date() and deprecation
Date Sun, 10 Jan 2016 09:29:45 GMT
Look at these resources for some indirect answers:
http://stackoverflow.com/questions/2901262/why-were-most-java-util-date-methods-deprecated
http://groovycookbook.org/basic_types/dates_times_jsr310/

On Sun, Jan 10, 2016 at 9:14 AM, James Northrop
<james.northrop@orange.fr> wrote:
> Hi Jerry
> never used eclipse myself as i find it tough to figure out if issues are
> actually code related or just a flaky IDE.
>
> what happens when you try dates in the groovyConsole or as a script ? i tend
> to use the groovyConsole as it (almost) always gives me code i can paste
> into the final product.
>
> if i feel really grumpy, this annotation helps:  @SuppressWarnings(
> "deprecation" )
>
> also i only use ISO  dates and just convert back&forth but rarely use local
> date approach. almost worth roll your own Date class for future stuff.
>
> Have a GR8 day !
> thx
> jim
>
>
> On Jan 10, 2016, at 5:41 AM, Gerald Wiltse wrote:
>
> 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
> 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