Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-11513

java.time.* should be imported automatically

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 4.0.23
    • 4.x
    • Compiler
    • None

    Description

      if java.time is the recommended way to proceed forward when dealing with dates,
      java.time.* should be included automatically similar to how java.util.Date is currently available without import. 

      The preferred approach would be to make it a global import which would be in line with existing Groovy handling of java.util.Date

       
      The least invasive  approach would be to make the import only apply if groovy-datetime module has been added.
       
      implementation "org.apache.groovy:groovy-datetime"
       
      should automatically import java.time.* to all classes
       
      This provides an easier migration path from Date -> DateTIme

      https://groovy.apache.org/blog/groovy-dates-and-times-cheat

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            scottheiberg Scott

            Dates

              Created:
              Updated:

              Slack

                Issue deployment