[ https://issues.apache.org/jira/browse/GROOVY-11513?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17947503#comment-17947503 ]
ASF GitHub Bot commented on GROOVY-11513: ----------------------------------------- paulk-asert commented on PR #2156: URL: https://github.com/apache/groovy/pull/2156#issuecomment-2832009463 @codeconsole I agree this would be nice to have. We just have to weigh up all pros and cons. We treat breaking existing code seriously and such changes proceed more slowly due to the extra caution. We sometimes do it anyway when it is a clear win. We know in such cases that we have to be extra clear in our release notes and messaging. The particular aspect of breaking domain classes with no package is one that has bitten us before. I think it was in fact with Grails. Some folks had no package domain classes named Singleton and we introduced an annotation in groovy.lang which is auto-imported. (It was made worse by various other inject Singleton annotations too.) @eric-milles Are you still in favor? Did you want to do a VOTE/DISCUSS thread on the mailing list? > java.time.* should be imported automatically > -------------------------------------------- > > Key: GROOVY-11513 > URL: https://issues.apache.org/jira/browse/GROOVY-11513 > Project: Groovy > Issue Type: Improvement > Components: Compiler > Affects Versions: 4.0.23 > Reporter: Scott Murphy Heiberg > Assignee: Eric Milles > Priority: Major > Labels: breaking > > 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] -- This message was sent by Atlassian Jira (v8.20.10#820010)