Skip to content

Add long index support to ZRangeParams (#4445)#4446

Merged
ggivo merged 2 commits intomasterfrom
topic/ggivo/4445-zrange-params-from-long
Feb 27, 2026
Merged

Add long index support to ZRangeParams (#4445)#4446
ggivo merged 2 commits intomasterfrom
topic/ggivo/4445-zrange-params-from-long

Conversation

@ggivo
Copy link
Copy Markdown
Collaborator

@ggivo ggivo commented Feb 25, 2026

Adds ZRangeParams.zrangeParams(long, long) overload to support large sorted set indexes, resolving deprecation gap where zrevrangeWithScores(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 a long constructor), and makes the existing int constructor delegate to the long path to support large sorted-set index ranges without precision loss.

Expands test coverage to assert correct argument/RESP serialization for large long values, introduces reusable CommandArgumentsMatchers + ProtocolTestUtil test helpers, updates affected tests/imports, and broadens the formatter include patterns in pom.xml accordingly.

Written by Cursor Bugbot for commit 9fb4feb. This will update automatically on new commits. Configure here.

@jit-ci
Copy link
Copy Markdown

jit-ci Bot commented Feb 25, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 25, 2026

Test Results

   301 files  ± 0     301 suites  ±0   12m 1s ⏱️ +16s
10 922 tests +14  10 866 ✅ +14  56 💤 ±0  0 ❌ ±0 
 5 639 runs  + 8   5 630 ✅ + 8   9 💤 ±0  0 ❌ ±0 

Results for commit 9fb4feb. ± Comparison against base commit f669f98.

♻️ This comment has been updated with latest results.

@ggivo ggivo requested a review from Copilot February 25, 2026 12:59
@ggivo ggivo self-assigned this Feb 25, 2026
@ggivo ggivo requested a review from atakavci February 25, 2026 12:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/main/java/redis/clients/jedis/params/ZRangeParams.java Outdated
@ggivo ggivo force-pushed the topic/ggivo/4445-zrange-params-from-long branch from 1cc273c to af9df7a Compare February 26, 2026 09:35
resolves #4445

# Conflicts:
#	src/test/java/redis/clients/jedis/commands/jedis/SortedSetCommandsTest.java
#	src/test/java/redis/clients/jedis/commands/unified/SortedSetCommandsTestBase.java
@ggivo ggivo force-pushed the topic/ggivo/4445-zrange-params-from-long branch from a66494a to 9fb4feb Compare February 26, 2026 10:41
@ggivo ggivo added this to the 7.4.0 milestone Feb 26, 2026
Copy link
Copy Markdown
Contributor

@atakavci atakavci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ggivo ggivo merged commit 7b59bdd into master Feb 27, 2026
15 checks passed
@ggivo ggivo deleted the topic/ggivo/4445-zrange-params-from-long branch March 24, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecation gap: no non-deprecated descending range-with-scores API that supports long start/end indexes

3 participants