Fix compilation failure in LettuceConnection.

Compilation failure was caused by a missing local variable declaration ('command', which was declared as 'redisCommand') on line 1036.

Closes #2756
This commit is contained in:
John Blum
2023-10-23 12:59:00 -07:00
parent a0ddc0ec0f
commit 8fefea7dce

View File

@@ -1027,10 +1027,11 @@ public class LettuceConnection extends AbstractRedisConnection {
private void validateCommand(ProtocolKeyword cmd, @Nullable byte[]... args) {
RedisCommand redisCommand = RedisCommand.failsafeCommandLookup(cmd.name());
if (!RedisCommand.UNKNOWN.equals(redisCommand) && redisCommand.requiresArguments()) {
RedisCommand command = RedisCommand.failsafeCommandLookup(cmd.name());
if (!RedisCommand.UNKNOWN.equals(command) && command.requiresArguments()) {
try {
redisCommand.validateArgumentCount(args != null ? args.length : 0);
command.validateArgumentCount(args != null ? args.length : 0);
} catch (IllegalArgumentException ex) {
String message = String.format("Validation failed for %s command", command);
throw new InvalidDataAccessApiUsageException(message, ex);