netudima commented on code in PR #4038: URL: https://github.com/apache/cassandra/pull/4038#discussion_r2264839040
########## src/java/org/apache/cassandra/schema/KeyspaceMetadata.java: ########## @@ -62,6 +64,32 @@ public final class KeyspaceMetadata implements SchemaElement { public static final Serializer serializer = new Serializer(); + /** + * Validates the keyspace name for valid characters and correct length. + * Throws an exception if it's invalid. + * + * @param keyspaceName The name of the keyspace to validate + * @param ex The exception class to throw if validation fails + */ + public static <T extends RequestValidationException> void validateKeyspaceName(String keyspaceName, Class<T> ex) + { + try + { + if (!SchemaConstants.isValidCharsName(keyspaceName)) + throw ex.getConstructor(String.class) + .newInstance(format("Table name must not be empty or not contain non-alphanumeric-underscore characters (got \"%s\")", Review Comment: the method is to validate a keyspace name but the exception message it produces says: "Table name .." -- 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