spring-projects / spring-projects/spring-data-redis

setIfAbsent return value is unclear

Open Beginner friendly
#3,414 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
1.9k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

The Javadoc for org.springframework.data.redis.core.ValueOperations#setIfAbsent(K, V) is:

	/**
	 * Set the {@code value} for {@code key} if {@code key} is absent.
	 *
	 * @param key must not be {@literal null}.
	 * @param value must not be {@literal null}.
	 * @return {@literal null} when used in pipeline / transaction.
	 * @see <a href="https://redis.io/commands/set">Redis Documentation: SET</a>
	 */

This does not mention what the method returns when not used in pipeline / transaction.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open org.springframework.data.redis.core.ValueOperations#setIfAbsent(K, V) and read its existing Javadoc, especially the return description. Update the documentation to state the return value outside pipeline or transaction use; done means both execution contexts are clearly described.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, redis
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.