CommandObjects refactoring Part 2: remove protocol setter and make protocol ummutable#4514
Merged
Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
9c3f4de to
ebf4b67
Compare
ggivo
reviewed
May 11, 2026
Collaborator
ggivo
left a comment
There was a problem hiding this comment.
left some comment on PART one,
Considering they are addressed separately
LGTM
…ecated constructors
08fd10b to
4923232
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Medium Risk
Touches core client command construction by making
RedisProtocolimmutable and changing howCommandObjectsis instantiated acrossJedis/cluster/multi-db flows, which could affect protocol selection at runtime. Risk is moderated by mostly-constructor-level refactoring plus updated tests, but mis-defaulting to RESP2/RESP3 could cause subtle behavior differences.Overview
Refactors
CommandObjectsto require aRedisProtocolat construction time (protocol is nowfinalandsetProtocol/no-arg ctor are removed), and deletes several deprecated constructors that previously created a protocol-less instance and later mutated it.Updates
Jedisand related cluster/multi-db transaction/pipeline entry points to always buildCommandObjectswith an explicit protocol (defaulting toRESP2when unspecified), removes a test-onlyUnifiedJedisconstructor that probed connections to override protocol, and adjusts unit tests to pass explicitRedisProtocolvalues (including RESP3 where cache keys require it).Reviewed by Cursor Bugbot for commit 5bf34e0. Bugbot is set up for automated code reviews on this repo. Configure here.