Skip to content

Commit febdb82

Browse files
committed
Polishing.
Reformat code. Tweak Javadoc See #1816. Original pull request: #1968.
1 parent 507a882 commit febdb82

File tree

6 files changed

+16
-14
lines changed

6 files changed

+16
-14
lines changed

src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterZSetCommands.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -475,8 +475,8 @@ public Set<Tuple> zRangeByScoreWithScores(byte[] key, double min, double max, lo
475475
}
476476

477477
try {
478-
return toTupleSet(connection.getCluster().zrangeByScoreWithScores(key, min, max,
479-
Long.valueOf(offset).intValue(), Long.valueOf(count).intValue()));
478+
return toTupleSet(connection.getCluster().zrangeByScoreWithScores(key, min, max, Long.valueOf(offset).intValue(),
479+
Long.valueOf(count).intValue()));
480480
} catch (Exception ex) {
481481
throw convertJedisAccessException(ex);
482482
}

src/main/java/org/springframework/data/redis/connection/jedis/JedisZSetCommands.java

+4-9
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,8 @@ public Set<Tuple> zRevRangeByScoreWithScores(byte[] key, Range range, Limit limi
248248
.toSet(JedisConverters::toTuple);
249249
}
250250

251-
return connection.invoke()
252-
.fromMany(BinaryJedis::zrevrangeByScoreWithScores, MultiKeyPipelineBase::zrevrangeByScoreWithScores, key, max,
253-
min)
254-
.toSet(JedisConverters::toTuple);
251+
return connection.invoke().fromMany(BinaryJedis::zrevrangeByScoreWithScores,
252+
MultiKeyPipelineBase::zrevrangeByScoreWithScores, key, max, min).toSet(JedisConverters::toTuple);
255253
}
256254

257255
/*
@@ -511,10 +509,8 @@ public Set<byte[]> zRangeByScore(byte[] key, String min, String max, long offset
511509
}
512510
String keyStr = new String(key, StandardCharsets.UTF_8);
513511

514-
return connection.invoke()
515-
.fromMany(Jedis::zrangeByScore, MultiKeyPipelineBase::zrangeByScore, keyStr, min, max, (int) offset,
516-
(int) count)
517-
.toSet(JedisConverters::toBytes);
512+
return connection.invoke().fromMany(Jedis::zrangeByScore, MultiKeyPipelineBase::zrangeByScore, keyStr, min, max,
513+
(int) offset, (int) count).toSet(JedisConverters::toBytes);
518514
}
519515

520516
/*
@@ -575,7 +571,6 @@ public Set<byte[]> zRevRangeByLex(byte[] key, Range range, Limit limit) {
575571
byte[] min = JedisConverters.boundaryToBytesForZRangeByLex(range.getMin(), JedisConverters.MINUS_BYTES);
576572
byte[] max = JedisConverters.boundaryToBytesForZRangeByLex(range.getMax(), JedisConverters.PLUS_BYTES);
577573

578-
579574
if (!limit.isUnlimited()) {
580575
return connection.invoke().from(BinaryJedis::zrevrangeByLex, MultiKeyPipelineBase::zrevrangeByLex, key, max, min,
581576
limit.getOffset(), limit.getCount()).get(LinkedHashSet::new);

src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1925,7 +1925,7 @@ void testZRemRangeByLex() {
19251925
actual.add(connection.zRemRangeByLex("myset", Range.range().gte("alpha").lte("omega")));
19261926

19271927
actual.add(connection.zRange("myset", 0L, -1L));
1928-
verifyResults(Arrays.asList(new Object[] { true, true, true,true, true, true,true, true, true,true, 6L, new LinkedHashSet<String>(Arrays.asList("ALPHA", "aaaa", "zap", "zip")) }));
1928+
verifyResults(Arrays.asList( true, true, true, true, true, true, true, true, true, true, 6L, new LinkedHashSet<>(Arrays.asList("ALPHA", "aaaa", "zap", "zip"))));
19291929
}
19301930

19311931
@Test
@@ -1935,7 +1935,8 @@ void testZRemRangeByScore() {
19351935
actual.add(connection.zRemRangeByScore("myset", 0d, 1d));
19361936
actual.add(connection.zRange("myset", 0L, -1L));
19371937
verifyResults(
1938-
Arrays.asList(new Object[] { true, true, 1L, new LinkedHashSet<>(Arrays.asList("Bob")) }));
1938+
Arrays.asList(new Object[] { true, true, 1L, new LinkedHashSet<>(Collections
1939+
.singletonList("Bob")) }));
19391940
}
19401941

19411942
@Test

src/test/java/org/springframework/data/redis/core/ConnectionMockingRedisTemplate.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@
2121
import org.springframework.data.redis.serializer.RedisSerializer;
2222

2323
/**
24+
* Test extension to {@link RedisTemplate} to use a Mockito mocked {@link RedisConnection}.
25+
*
2426
* @author Christoph Strobl
2527
*/
2628
public class ConnectionMockingRedisTemplate<K, V> extends RedisTemplate<K, V> {
2729

28-
private RedisConnection connectionMock;
30+
private final RedisConnection connectionMock;
2931

3032
private ConnectionMockingRedisTemplate() {
3133

src/test/java/org/springframework/data/redis/core/DefaultBoundZSetOperationsUnitTests.java

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import org.springframework.data.redis.connection.RedisZSetCommands.Range;
2323

2424
/**
25+
* Unit tests for {@link DefaultBoundZSetOperations}.
26+
*
2527
* @author Christoph Strobl
2628
*/
2729
class DefaultBoundZSetOperationsUnitTests {

src/test/java/org/springframework/data/redis/core/DefaultZSetOperationsUnitTests.java

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import org.springframework.data.redis.connection.RedisZSetCommands.Range;
2323

2424
/**
25+
* Unit tests for {@link DefaultZSetOperations}.
26+
*
2527
* @author Christoph Strobl
2628
*/
2729
class DefaultZSetOperationsUnitTests {

0 commit comments

Comments
 (0)