Skip to content

Commit

Permalink
Fix typo in SetPipelineCommands method name (#3773)
Browse files Browse the repository at this point in the history
* Fix typo in SetPipelineCommands method name

One method in the SetPipelineCommands interface does not respect the
general naming pattern. Add a new method that respects naming, and
deprecate the other one.

* Refine javadoc for the deprecated method

Co-authored-by: M Sazzadul Hoque <[email protected]>

---------

Co-authored-by: Gabriel Erzse <[email protected]>
Co-authored-by: M Sazzadul Hoque <[email protected]>
  • Loading branch information
3 people authored Mar 15, 2024
1 parent 24653e0 commit 33b43cf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/redis/clients/jedis/PipeliningBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ public Response<Set<String>> sdiff(String... keys) {
}

@Override
public Response<Long> sdiffStore(String dstKey, String... keys) {
public Response<Long> sdiffstore(String dstKey, String... keys) {
return appendCommand(commandObjects.sdiffstore(dstKey, keys));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,15 @@ default Response<ScanResult<String>> sscan(String key, String cursor) {

Response<Set<String>> sdiff(String... keys);

Response<Long> sdiffStore(String dstKey, String... keys);
Response<Long> sdiffstore(String dstKey, String... keys);

/**
* @deprecated Use {@link SetPipelineCommands#sdiffstore(java.lang.String, java.lang.String...)}.
*/
@Deprecated
default Response<Long> sdiffStore(String dstKey, String... keys) {
return sdiffstore(dstKey, keys);
}

Response<Set<String>> sinter(String... keys);

Expand Down
4 changes: 3 additions & 1 deletion src/test/java/redis/clients/jedis/ClusterPipeliningTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,8 @@ public void clusterPipelineSet() {
Response<Long> r1 = p.sadd("my{set}", "hello", "hello", "world", "foo", "bar");
p.sadd("mynew{set}", "hello", "hello", "world");
Response<Set<String>> r2 = p.sdiff("my{set}", "mynew{set}");
Response<Long> r3 = p.sdiffStore("diffset{set}", "my{set}", "mynew{set}");
Response<Long> r3deprecated = p.sdiffStore("diffset{set}deprecated", "my{set}", "mynew{set}");
Response<Long> r3 = p.sdiffstore("diffset{set}", "my{set}", "mynew{set}");
Response<Set<String>> r4 = p.smembers("diffset{set}");
Response<Set<String>> r5 = p.sinter("my{set}", "mynew{set}");
Response<Long> r6 = p.sinterstore("interset{set}", "my{set}", "mynew{set}");
Expand All @@ -547,6 +548,7 @@ public void clusterPipelineSet() {
p.sync();
assertEquals(Long.valueOf(4), r1.get());
assertEquals(diff, r2.get());
assertEquals(Long.valueOf(diff.size()), r3deprecated.get());
assertEquals(Long.valueOf(diff.size()), r3.get());
assertEquals(diff, r4.get());
assertEquals(inter, r5.get());
Expand Down

0 comments on commit 33b43cf

Please sign in to comment.