k-rus commented on code in PR #4038: URL: https://github.com/apache/cassandra/pull/4038#discussion_r2281837085
########## src/java/org/apache/cassandra/schema/IndexMetadata.java: ########## @@ -117,29 +114,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(""); Review Comment: > so can you submit a new commit and just restore them to the original states? What do you mean? It's in a separate commit already. Do you want to change the order of the commits? ########## src/java/org/apache/cassandra/schema/IndexMetadata.java: ########## @@ -117,29 +114,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(""); Review Comment: > so can you submit a new commit and just restore them to the original states? What do you mean? It's in a separate commit already. Do you want to suggest to change the order of the commits? -- 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: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org