Claudenw commented on code in PR #626:
URL: https://github.com/apache/creadur-rat/pull/626#discussion_r2935415283
##########
apache-rat-core/src/main/java/org/apache/rat/utils/CasedString.java:
##########
@@ -19,177 +19,244 @@
package org.apache.rat.utils;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import java.util.Locale;
+import java.util.Objects;
import java.util.function.Function;
import java.util.function.Predicate;
+import java.util.function.UnaryOperator;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.text.WordUtils;
/**
* Handles converting from one string case to another (e.g. camel case to
snake case).
* @since 0.17
*/
-public class CasedString {
- /** the string of the cased format. */
- private final String string;
- /** the case of the string. */
+public final class CasedString {
+ /** The segments of the cased string */
+ private final String[] segments;
+ /** The case of the string as parsed */
private final StringCase stringCase;
+ /** A joiner used for the pascal and camel cases. */
+ private static final Function<String[], String> PASCAL_JOINER = strings ->
{
Review Comment:
Since each invocation of the method creates a local StringBuilder I don't
see any thread issues.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]