You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "paulk-asert (via GitHub)" <gi...@apache.org> on 2023/02/19 07:28:44 UTC

[GitHub] [groovy] paulk-asert commented on pull request #1859: Add `extension` & `nameWithoutExtension` extension methods

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

   I like the idea behind these extensions. Can you create a corresponding Jira issue?
   
   Also, some minor points:
   
   - I think using `getExtension` rather than `extension` would be closer to existing methods. WDYT?
   - Also, `extension` doesn't currently return empty string when there is no extension. This is what the javadocs state but not what the implementation does. The javadoc matches how Kotlin and commons-io FilenameUtils behave.
   - An alternative to `nameWithoutExtension` is `baseName` (what commons-io uses) or just `basename` (again, I'd go with the getter variant). I guess there is some merit in following Kotlin but `basename` would certainly be shorter. WDYT?
   
   Naming is always tricky, we can always ask on the mailing list if we want to confirm preferences.


-- 
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-unsubscribe@groovy.apache.org

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