worryg0d commented on code in PR #4379:
URL: https://github.com/apache/cassandra/pull/4379#discussion_r2362975078
##########
src/java/org/apache/cassandra/db/guardrails/CassandraPasswordConfiguration.java:
##########
@@ -173,6 +175,11 @@ public void validateParameters() throws
ConfigurationException
if (lengthWarn < 0) throw mustBePositiveException(LENGTH_WARN_KEY);
if (lengthFail < 0) throw mustBePositiveException(LENGTH_FAIL_KEY);
+ if (MAX_LENGTH < maxLength)
+ throw new ConfigurationException(format("%s can not be less than
or equal to %s",
+ MAX_LENGTH_KEY,
+ MAX_LENGTH));
+
Review Comment:
This comes up from the `MAX_LENGTH < maxLength` condition, doesn't it? If
the value defined in `max_length` is greater than `MAX_LENGTH` const, it throws
an exception stating that the value of `max_length` can't be greater than.
Also, I didn't realize it at first, but even if the value of `maxLength` is
equal to `MAX_LENGTH`, it won't throw an exception because the condition
strictly ensures that `maxLength` is GREATER, not greater than or equal. But
the error message states that it can't be equal to `MAX_LENGTH`.
--
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]