GeezerVison is showing github.com — Accept null VAddParams in vaddFP32 with reduceDim by HDPark95 · Pull Request #4684 · redis/jedis
Conversation
HDPark95
commented
Aug 15, 2026
•
edited by cursor
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
CommandObjects.vaddFP32(String, byte[], String, int, VAddParams) called args.addParams(params) directly, so a null params threw NullPointerException before the command was built.
Key Decisions & Assumptions
The other 21 vector set overloads route params through the null tolerant addOptionalParams helper, including the binary sibling vaddFP32(byte[], byte[], byte[], int, VAddParams), so the two paths disagreed on identical arguments. No overload takes reduceDim without params, so null is the only way to ask for FP32 plus REDUCE and nothing else.
Testing
CommandObjectsVectorSetTest needs no server. It pins the argv for the string and binary overloads with null params, plus a non-null case, and fails with the NPE on master. Full JDK 8 unit run: 3294 tests, 0 failures.
Note Low Risk
Single-line behavioral alignment with existing vector-set helpers; no auth, data, or API contract changes beyond fixing null params.
Overview
Fixes a null-handling bug in CommandObjects.vaddFP32 for the string-key overload that includes reduceDim. That method used args.addParams(params) directly, so passing null for VAddParams threw an NPE while building the command.
The change routes params through addOptionalParams, matching the other vector-set vadd / vaddFP32 overloads (including the byte-key reduceDim variant). Callers can now use FP32 + REDUCE with no extra VADD options by passing null params.
Reviewed by Cursor Bugbot for commit 1e8e135. Bugbot is set up for automated code reviews on this repo. Configure here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
vaddFP32(String, byte[], String, int, VAddParams) called
args.addParams(params) directly, so a null params threw a
NullPointerException before the command was built.
The other 21 vector set overloads route params through the null
tolerant addOptionalParams helper, including the binary sibling
vaddFP32(byte[], byte[], byte[], int, VAddParams), so the string
and binary paths disagreed on the same arguments. There is no
vaddFP32 overload that takes reduceDim without params, so passing
null is the only way to ask for FP32 plus REDUCE and nothing else.
Route this overload through the same helper.
Regression coverage is CommandObjectsVectorSetTest, a unit test that
needs no server: it pins the VADD argv for both the string and binary
overloads with null params, and keeps a non-null case to show the
options are still appended.
Any test of the null fix pins null-params acceptance as public
contract, which redis#4688 plans to replace with plain
overloads while the API is still @experimental. Coverage for the
family arrives with that work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e8e135f3a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
Taking the one-line fix for 8.1.0 — it unifies the String overload with the rest of the vadd family, which already tolerates null params. Dropped the tests in 0c4f93a on purpose: they'd cement null-acceptance as tested contract, and #4688 plans to replace null with plain overloads while the API is still @experimental;
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|