[
https://issues.apache.org/jira/browse/TEXT-238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18019887#comment-18019887
]
Kushal Dixit commented on TEXT-238:
-----------------------------------
*Just to clarify on the AI point:*
I did not use AI for any part of the committed code or Javadoc, basically
anything that could potentially be merged into the library is fully my own work.
Since this was my first Commons contribution, I wanted to make sure my Jira
description and follow-up comments were polished and free of grammatical
mistakes, so I used AI only for refining the wording there. Apologies if that
caused any confusion.
*Regarding the PR:*
I wasn't aware of PR #450. If that already addresses the kind of changes I
suggested, I am happy to close my PR.
I have been using Commons libraries as a consumer for over 10 years across
different projects, so my main goal here was to contribute back and help
enhance it, not just to get a change merged.
> Overload CaseUtils.toCamelCase to default capitalizeFirstLetter=false
> ---------------------------------------------------------------------
>
> Key: TEXT-238
> URL: https://issues.apache.org/jira/browse/TEXT-238
> Project: Commons Text
> Issue Type: Improvement
> Affects Versions: 1.14.0
> Reporter: Kushal Dixit
> Priority: Minor
>
> Right now, {{CaseUtils.toCamelCase(String, boolean, char...)}} always
> requires specifying the {{capitalizeFirstLetter}} flag.
> In most real-world cases, users just want to convert a string to camelCase
> with the first letter lowercased by default, as that is basically what
> camelCase means originally.
> *Proposal:* add a new overload:
> {code:java}
> public static String toCamelCase(String str, char... delimiters) { ... }
> {code}
> * Since {{delimiters}} is already a varargs parameter, an overload without
> delimiters is not needed; callers can just omit it.
> * This overload will also be beneficial for *method references* in JDK 8+,
> making code like {{list.stream().map(CaseUtils::toCamelCase)}} cleaner.
> *Examples:*
> {code:java}
> CaseUtils.toCamelCase("java-utils", '-'); // javaUtils
> CaseUtils.toCamelCase("convert this string"); // convertThisString
> CaseUtils.toCamelCase("hello_world", '_') // helloWorld{code}
> *Why it’s useful:*
> Most callers just want the first letter lowercased. Requiring {{false}} every
> time is unnecessary boilerplate. This overload simplifies the API for the
> common case while keeping the existing method unchanged for backward
> compatibility.
> *Note:* Looking for feedback and approval. If this makes sense, I will raise
> a PR with proper documentation and unit tests.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)