k-rus commented on code in PR #4038:
URL: https://github.com/apache/cassandra/pull/4038#discussion_r2281637732
##########
src/java/org/apache/cassandra/schema/IndexMetadata.java:
##########
@@ -111,29 +108,25 @@ public static IndexMetadata
fromIndexTargets(List<IndexTarget> targets,
{
Map<String, String> newOptions = new HashMap<>(options);
newOptions.put(IndexTarget.TARGET_OPTION_NAME, targets.stream()
- .map(target ->
target.asCqlString())
+
.map(IndexTarget::asCqlString)
.collect(Collectors.joining(", ")));
return new IndexMetadata(name, newOptions, kind);
}
- public static boolean isNameValid(String name)
- {
- return name != null && !name.isEmpty() &&
PATTERN_WORD_CHARS.matcher(name).matches();
- }
-
public static String generateDefaultIndexName(String table,
ColumnIdentifier column)
{
- return PATTERN_NON_WORD_CHAR.matcher(table + "_" + column.toString() +
"_idx").replaceAll("");
+ return PATTERN_NON_WORD_CHAR.matcher(table + '_' + column.toString() +
"_idx").replaceAll("");
}
public static String generateDefaultIndexName(String table)
{
- return PATTERN_NON_WORD_CHAR.matcher(table + "_" +
"idx").replaceAll("");
+ return PATTERN_NON_WORD_CHAR.matcher(table + "_idx").replaceAll("");
}
public void validate(TableMetadata table)
{
- if (!isNameValid(name))
+ // Validating the length will be addressed by CASSANDRA-20445
Review Comment:
I updated this comment to prefix with `TODO` as discussed in DM.
--
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]