paulk-asert commented on PR #2156:
URL: https://github.com/apache/groovy/pull/2156#issuecomment-2822890969

   In general, it is domain classes that have the same name as the java.time 
classes and no package that catch us out.
   
   E.g. for a `Main.groovy` file containing `println Period.ZERO` and a project 
containing this top-level class:
   ```
   class Period {
        public static final ZERO = 'Nothing to see here'
   }
   ```
   Running `Main` currently outputs:
   
   > Nothing to see here
   
   But after this change will output (toString for java.time.Period#ZERO):
   
   > P0D
   
   I don't believe there is a problem for classes with a package since classes 
in the same package and references via existing imports would come before the 
default imports.
   
   The other potentially problematic cases would be existing classes that are 
currently picked up by e.g. the groovy.util.* default import that might now 
come after java.time.*, but groovy.time.Duration (for instance) isn't a default 
import, so I believe we are good there. If folks have not followed split 
packaging naming conventions and have gone and created their own groovy.util 
packaged classes, maybe wrapping joda time or some such, with names like Month, 
Year, etc., they would be impacted. We don't prohibit that in the compiler 
currently but I would think it rare and maybe something we wouldn't care 
strongly about.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@groovy.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to