adelapena commented on code in PR #2236:
URL: https://github.com/apache/cassandra/pull/2236#discussion_r1155900652
##########
src/java/org/apache/cassandra/cql3/functions/CastFcts.java:
##########
@@ -126,25 +130,38 @@ private static <I extends Number>
java.util.function.Function<I, BigDecimal> get
}
/**
- * Creates the name of the cast function use to cast to the specified type.
+ * Creates the snake-cased name of the cast function used to cast to the
specified type.
*
* @param outputType the output type
- * @return the name of the cast function use to cast to the specified type
+ * @return the name of the cast function used to cast to the specified type
*/
- public static String getFunctionName(AbstractType<?> outputType)
+ public static String getFunctionName(CQL3Type outputType)
{
- return getFunctionName(outputType.asCQL3Type());
+ return FUNCTION_NAME_PREFIX + toLowerCaseString(outputType);
}
/**
- * Creates the name of the cast function use to cast to the specified type.
+ * Creates the legacy camel-cased name of the cast function used to cast
to the specified type.
*
* @param outputType the output type
- * @return the name of the cast function use to cast to the specified type
+ * @return the legacy camel-cased name of the cast function used to cast
to the specified type
*/
- public static String getFunctionName(CQL3Type outputType)
+ private static String getLegacyFunctionName(CQL3Type outputType)
+ {
+ return LEGACY_FUNCTION_NAME_PREFIX +
WordUtils.capitalize(toLowerCaseString(outputType));
Review Comment:
It would, since the first word be capitalized independently of spaces or
underscores. For example, `int` would become `Int`.
What we could do here, by the way, is replacing the deprecated
`WordUtils.capitalize` by the newer `StringUtils.capitalize`.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]