Add long index support to ZRangeParams (#4445)#4446
Merged
Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds long index support for ZRANGE parameter construction to close the deprecation gap for reverse range-with-scores APIs that previously accepted long start/stop indexes.
Changes:
- Add
ZRangeParams.zrangeParams(long, long)factory overload. - Refactor
ZRangeParams(int, int)to delegate to an internal long-based constructor. - Add regression tests exercising the new long overload in both unified and Jedis command test suites.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/main/java/redis/clients/jedis/params/ZRangeParams.java |
Adds long overload for index-based ZRANGE param construction; refactors int ctor to long. |
src/test/java/redis/clients/jedis/commands/unified/SortedSetCommandsTestBase.java |
Adds test covering ZRangeParams.zrangeParams(long, long) usage with rev(). |
src/test/java/redis/clients/jedis/commands/jedis/SortedSetCommandsTest.java |
Adds equivalent test in Jedis-specific suite for long overload usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1cc273c to
af9df7a
Compare
resolves #4445 # Conflicts: # src/test/java/redis/clients/jedis/commands/jedis/SortedSetCommandsTest.java # src/test/java/redis/clients/jedis/commands/unified/SortedSetCommandsTestBase.java
a66494a to
9fb4feb
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.
Adds
ZRangeParams.zrangeParams(long, long)overload to support large sorted set indexes, resolving deprecation gap wherezrevrangeWithScores(long, long)had no non-deprecated replacement for long indexes.Fixes #4445
Note
Low Risk
Small API extension and constructor delegation change in
ZRangeParams; risk is limited to potential edge-case differences in argument encoding/equality for range parameters, covered by added tests.Overview
Adds
ZRangeParams.zrangeParams(long, long)(and alongconstructor), and makes the existingintconstructor delegate to thelongpath to support large sorted-set index ranges without precision loss.Expands test coverage to assert correct argument/RESP serialization for large
longvalues, introduces reusableCommandArgumentsMatchers+ProtocolTestUtiltest helpers, updates affected tests/imports, and broadens the formatter include patterns inpom.xmlaccordingly.Written by Cursor Bugbot for commit 9fb4feb. This will update automatically on new commits. Configure here.