> entries = new ArrayList<>(it.size());
- it.forEach((k, v) -> entries.add(Converters.entryOf(k, v)));
+ return convertedMapEntryList;
- return entries;
});
}
diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisInvoker.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisInvoker.java
index 805efabe4b..b049274240 100644
--- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisInvoker.java
+++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisInvoker.java
@@ -17,7 +17,6 @@
import redis.clients.jedis.Jedis;
import redis.clients.jedis.Pipeline;
-import redis.clients.jedis.Queable;
import redis.clients.jedis.Response;
import redis.clients.jedis.Transaction;
import redis.clients.jedis.commands.DatabasePipelineCommands;
@@ -47,7 +46,7 @@
* composing a functional pipeline to transform the result using a {@link Converter}.
*
* Usage example:
- *
+ *
*
* JedisInvoker invoker = …;
*
@@ -62,6 +61,7 @@
*
* @author Mark Paluch
* @author Christoph Strobl
+ * @author John Blum
* @since 2.5
*/
class JedisInvoker {
@@ -82,7 +82,7 @@ R just(ConnectionFunction0 function) {
Assert.notNull(function, "ConnectionFunction must not be null");
- return synchronizer.invoke(function::apply, it -> {
+ return synchronizer.invoke(function::apply, responseCommands -> {
throw new InvalidDataAccessApiUsageException("Operation not supported by Jedis in pipelining/transaction mode");
}, Converters.identityConverter(), () -> null);
}
@@ -115,7 +115,8 @@ R just(ConnectionFunction1 function, PipelineFunction1 pip
Assert.notNull(function, "ConnectionFunction must not be null");
Assert.notNull(pipelineFunction, "PipelineFunction must not be null");
- return synchronizer.invoke(it -> function.apply(it, t1), it -> pipelineFunction.apply(it, t1));
+ return synchronizer.invoke(jedis -> function.apply(jedis, t1),
+ responseCommands -> pipelineFunction.apply(responseCommands, t1));
}
/**
@@ -133,7 +134,8 @@ R just(ConnectionFunction2 function, PipelineFunction2 function.apply(it, t1, t2), it -> pipelineFunction.apply(it, t1, t2));
+ return synchronizer.invoke(jedis -> function.apply(jedis, t1, t2),
+ responseCommands -> pipelineFunction.apply(responseCommands, t1, t2));
}
/**
@@ -152,7 +154,8 @@ R just(ConnectionFunction3 function, PipelineFunc
Assert.notNull(function, "ConnectionFunction must not be null");
Assert.notNull(pipelineFunction, "PipelineFunction must not be null");
- return synchronizer.invoke(it -> function.apply(it, t1, t2, t3), it -> pipelineFunction.apply(it, t1, t2, t3));
+ return synchronizer.invoke(jedis -> function.apply(jedis, t1, t2, t3),
+ responseCommands -> pipelineFunction.apply(responseCommands, t1, t2, t3));
}
/**
@@ -172,7 +175,7 @@ R just(ConnectionFunction4 function,
Assert.notNull(function, "ConnectionFunction must not be null");
Assert.notNull(pipelineFunction, "PipelineFunction must not be null");
- return synchronizer.invoke(it -> function.apply(it, t1, t2, t3, t4),
+ return synchronizer.invoke(jedis -> function.apply(jedis, t1, t2, t3, t4),
it -> pipelineFunction.apply(it, t1, t2, t3, t4));
}
@@ -194,7 +197,7 @@ R just(ConnectionFunction5 functi
Assert.notNull(function, "ConnectionFunction must not be null");
Assert.notNull(pipelineFunction, "PipelineFunction must not be null");
- return synchronizer.invoke(it -> function.apply(it, t1, t2, t3, t4, t5),
+ return synchronizer.invoke(jedis -> function.apply(jedis, t1, t2, t3, t4, t5),
it -> pipelineFunction.apply(it, t1, t2, t3, t4, t5));
}
@@ -217,8 +220,8 @@ R just(ConnectionFunction6 function.apply(it, t1, t2, t3, t4, t5, t6),
- it -> pipelineFunction.apply(it, t1, t2, t3, t4, t5, t6));
+ return synchronizer.invoke(jedis -> function.apply(jedis, t1, t2, t3, t4, t5, t6),
+ responseCommands -> pipelineFunction.apply(responseCommands, t1, t2, t3, t4, t5, t6));
}
/**
@@ -265,7 +268,7 @@ SingleInvocationSpec from(ConnectionFunction1 function, Pipeli
Assert.notNull(function, "ConnectionFunction must not be null");
Assert.notNull(pipelineFunction, "PipelineFunction must not be null");
- return from(it -> function.apply(it, t1), it -> pipelineFunction.apply(it, t1));
+ return from(jedis -> function.apply(jedis, t1), responseCommands -> pipelineFunction.apply(responseCommands, t1));
}
/**
@@ -283,7 +286,8 @@ SingleInvocationSpec from(ConnectionFunction2 function
Assert.notNull(function, "ConnectionFunction must not be null");
Assert.notNull(pipelineFunction, "PipelineFunction must not be null");
- return from(it -> function.apply(it, t1, t2), it -> pipelineFunction.apply(it, t1, t2));
+ return from(jedis -> function.apply(jedis, t1, t2),
+ responseCommands -> pipelineFunction.apply(responseCommands, t1, t2));
}
/**
@@ -302,7 +306,8 @@ SingleInvocationSpec from(ConnectionFunction3
Assert.notNull(function, "ConnectionFunction must not be null");
Assert.notNull(pipelineFunction, "PipelineFunction must not be null");
- return from(it -> function.apply(it, t1, t2, t3), it -> pipelineFunction.apply(it, t1, t2, t3));
+ return from(jedis -> function.apply(jedis, t1, t2, t3),
+ responseCommands -> pipelineFunction.apply(responseCommands, t1, t2, t3));
}
/**
@@ -322,7 +327,8 @@ SingleInvocationSpec from(ConnectionFunction4 function.apply(it, t1, t2, t3, t4), it -> pipelineFunction.apply(it, t1, t2, t3, t4));
+ return from(jedis -> function.apply(jedis, t1, t2, t3, t4),
+ responseCommands -> pipelineFunction.apply(responseCommands, t1, t2, t3, t4));
}
/**
@@ -343,7 +349,8 @@ SingleInvocationSpec from(ConnectionFunction5 function.apply(it, t1, t2, t3, t4, t5), it -> pipelineFunction.apply(it, t1, t2, t3, t4, t5));
+ return from(jedis -> function.apply(jedis, t1, t2, t3, t4, t5),
+ responseCommands -> pipelineFunction.apply(responseCommands, t1, t2, t3, t4, t5));
}
/**
@@ -365,8 +372,8 @@ SingleInvocationSpec from(ConnectionFunction6 function.apply(it, t1, t2, t3, t4, t5, t6),
- it -> pipelineFunction.apply(it, t1, t2, t3, t4, t5, t6));
+ return from(jedis -> function.apply(jedis, t1, t2, t3, t4, t5, t6),
+ responseCommands -> pipelineFunction.apply(responseCommands, t1, t2, t3, t4, t5, t6));
}
/**
@@ -414,7 +421,8 @@ , E, T1> ManyInvocationSpec fromMany(ConnectionFuncti
Assert.notNull(function, "ConnectionFunction must not be null");
Assert.notNull(pipelineFunction, "PipelineFunction must not be null");
- return fromMany(it -> function.apply(it, t1), it -> pipelineFunction.apply(it, t1));
+ return fromMany(jedis -> function.apply(jedis, t1),
+ responseCommands -> pipelineFunction.apply(responseCommands, t1));
}
/**
@@ -432,7 +440,8 @@ , E, T1, T2> ManyInvocationSpec fromMany(ConnectionFu
Assert.notNull(function, "ConnectionFunction must not be null");
Assert.notNull(pipelineFunction, "PipelineFunction must not be null");
- return fromMany(it -> function.apply(it, t1, t2), it -> pipelineFunction.apply(it, t1, t2));
+ return fromMany(jedis -> function.apply(jedis, t1, t2),
+ responseCommands -> pipelineFunction.apply(responseCommands, t1, t2));
}
/**
@@ -451,7 +460,8 @@ , E, T1, T2, T3> ManyInvocationSpec fromMany(Connecti
Assert.notNull(function, "ConnectionFunction must not be null");
Assert.notNull(pipelineFunction, "PipelineFunction must not be null");
- return fromMany(it -> function.apply(it, t1, t2, t3), it -> pipelineFunction.apply(it, t1, t2, t3));
+ return fromMany(jedis -> function.apply(jedis, t1, t2, t3),
+ responseCommands -> pipelineFunction.apply(responseCommands, t1, t2, t3));
}
/**
@@ -472,7 +482,8 @@ , E, T1, T2, T3, T4> ManyInvocationSpec fromMany(
Assert.notNull(function, "ConnectionFunction must not be null");
Assert.notNull(pipelineFunction, "PipelineFunction must not be null");
- return fromMany(it -> function.apply(it, t1, t2, t3, t4), it -> pipelineFunction.apply(it, t1, t2, t3, t4));
+ return fromMany(jedis -> function.apply(jedis, t1, t2, t3, t4),
+ responseCommands -> pipelineFunction.apply(responseCommands, t1, t2, t3, t4));
}
/**
@@ -494,7 +505,8 @@ , E, T1, T2, T3, T4, T5> ManyInvocationSpec fromMany(
Assert.notNull(function, "ConnectionFunction must not be null");
Assert.notNull(pipelineFunction, "PipelineFunction must not be null");
- return fromMany(it -> function.apply(it, t1, t2, t3, t4, t5), it -> pipelineFunction.apply(it, t1, t2, t3, t4, t5));
+ return fromMany(jedis -> function.apply(jedis, t1, t2, t3, t4, t5),
+ responseCommands -> pipelineFunction.apply(responseCommands, t1, t2, t3, t4, t5));
}
/**
@@ -517,8 +529,8 @@ , E, T1, T2, T3, T4, T5, T6> ManyInvocationSpec fromM
Assert.notNull(function, "ConnectionFunction must not be null");
Assert.notNull(pipelineFunction, "PipelineFunction must not be null");
- return fromMany(it -> function.apply(it, t1, t2, t3, t4, t5, t6),
- it -> pipelineFunction.apply(it, t1, t2, t3, t4, t5, t6));
+ return fromMany(jedis -> function.apply(jedis, t1, t2, t3, t4, t5, t6),
+ responseCommands -> pipelineFunction.apply(responseCommands, t1, t2, t3, t4, t5, t6));
}
/**
@@ -937,10 +949,7 @@ static class DefaultSingleInvocationSpec implements SingleInvocationSpec {
@Override
public T get(Converter converter) {
-
- Assert.notNull(converter, "Converter must not be null");
-
- return synchronizer.invoke(parentFunction, parentPipelineFunction, converter, () -> null);
+ return getOrElse(converter, () -> null);
}
@Nullable
@@ -959,6 +968,7 @@ static class DefaultManyInvocationSpec implements ManyInvocationSpec {
private final Function>> parentPipelineFunction;
private final Synchronizer synchronizer;
+ @SuppressWarnings({ "rawtypes", "unchecked" })
DefaultManyInvocationSpec(Function> parentFunction,
Function>> parentPipelineFunction,
Synchronizer synchronizer) {
@@ -969,6 +979,7 @@ static class DefaultManyInvocationSpec implements ManyInvocationSpec {
}
@Override
+ @SuppressWarnings("all")
public List toList(Converter converter) {
Assert.notNull(converter, "Converter must not be null");
@@ -981,15 +992,17 @@ public List toList(Converter converter) {
List result = new ArrayList<>(source.size());
- for (S s : source) {
- result.add(converter.convert(s));
+ for (S element : source) {
+ result.add(converter.convert(element));
}
return result;
+
}, Collections::emptyList);
}
@Override
+ @SuppressWarnings("all")
public Set toSet(Converter converter) {
Assert.notNull(converter, "Converter must not be null");
@@ -1002,11 +1015,12 @@ public Set toSet(Converter converter) {
Set result = new LinkedHashSet<>(source.size());
- for (S s : source) {
- result.add(converter.convert(s));
+ for (S element : source) {
+ result.add(converter.convert(element));
}
return result;
+
}, Collections::emptySet);
}
}
@@ -1020,6 +1034,7 @@ interface Synchronizer {
@Nullable
@SuppressWarnings({ "unchecked", "rawtypes" })
default T invoke(Function callFunction, Function> pipelineFunction) {
+
return (T) doInvoke((Function) callFunction, (Function) pipelineFunction, Converters.identityConverter(),
() -> null);
}
@@ -1046,15 +1061,13 @@ interface ResponseCommands extends PipelineBinaryCommands, DatabasePipelineComma
/**
* Create a proxy to invoke methods dynamically on {@link Pipeline} or {@link Transaction} as those share many
* commands that are not defined on a common super-type.
- *
- * @param pipelineOrTransaction
- * @return
*/
- static ResponseCommands createCommands(Queable pipelineOrTransaction) {
+ static ResponseCommands createCommands(Object pipelineOrTransaction) {
ProxyFactory proxyFactory = new ProxyFactory(pipelineOrTransaction);
+
proxyFactory.addInterface(ResponseCommands.class);
+
return (ResponseCommands) proxyFactory.getProxy(JedisInvoker.class.getClassLoader());
}
-
}
diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisResult.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisResult.java
index 3f96bb0b91..7e7e95e425 100644
--- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisResult.java
+++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisResult.java
@@ -24,24 +24,21 @@
import org.springframework.lang.Nullable;
/**
- * Jedis specific {@link FutureResult} implementation.
+ * {@link FutureResult} implementation for Jedis.
*
+ * @param The data type of the object that holds the future result (usually of type Future).
+ * @param The data type of the result type.
* @author Costin Leau
* @author Jennifer Hickey
* @author Christoph Strobl
* @author Mark Paluch
- * @param The data type of the object that holds the future result (usually of type Future).
- * @param The data type of the result type.
+ * @author John Blum
* @since 2.1
*/
class JedisResult extends FutureResult> {
private final boolean convertPipelineAndTxResults;
- JedisResult(Response resultHolder) {
- this(resultHolder, false, null);
- }
-
JedisResult(Response resultHolder, boolean convertPipelineAndTxResults, @Nullable Converter converter) {
this(resultHolder, () -> null, convertPipelineAndTxResults, converter);
}
@@ -50,6 +47,7 @@ class JedisResult extends FutureResult> {
@Nullable Converter converter) {
super(resultHolder, converter, defaultReturnValue);
+
this.convertPipelineAndTxResults = convertPipelineAndTxResults;
}
@@ -61,7 +59,7 @@ public T get() {
}
public boolean conversionRequired() {
- return convertPipelineAndTxResults;
+ return this.convertPipelineAndTxResults;
}
/**
@@ -69,10 +67,10 @@ public boolean conversionRequired() {
*/
static class JedisStatusResult extends JedisResult {
- @SuppressWarnings("unchecked")
JedisStatusResult(Response resultHolder, Converter converter) {
super(resultHolder, false, converter);
+
setStatus(true);
}
}
@@ -86,9 +84,12 @@ static class JedisStatusResult extends JedisResult {
*/
static class JedisResultBuilder {
- private final Response response;
- private Converter converter;
private boolean convertPipelineAndTxResults = false;
+
+ private Converter converter;
+
+ private final Response response;
+
private Supplier nullValueDefault = () -> null;
@SuppressWarnings("unchecked")
@@ -119,6 +120,7 @@ static JedisResultBuilder forResponse(Response response) {
JedisResultBuilder mappedWith(Converter converter) {
this.converter = converter;
+
return this;
}
@@ -131,12 +133,14 @@ JedisResultBuilder mappedWith(Converter converter) {
JedisResultBuilder mapNullTo(Supplier supplier) {
this.nullValueDefault = supplier;
+
return this;
}
JedisResultBuilder convertPipelineAndTxResults(boolean flag) {
- convertPipelineAndTxResults = flag;
+ this.convertPipelineAndTxResults = flag;
+
return this;
}
diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisZSetCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisZSetCommands.java
index 1aab87de0a..a19247a8d1 100644
--- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisZSetCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisZSetCommands.java
@@ -22,6 +22,7 @@
import redis.clients.jedis.params.ZParams;
import redis.clients.jedis.params.ZRangeParams;
import redis.clients.jedis.resps.ScanResult;
+import redis.clients.jedis.util.KeyValue;
import java.util.LinkedHashSet;
import java.util.List;
@@ -31,7 +32,6 @@
import org.springframework.dao.InvalidDataAccessApiUsageException;
import org.springframework.data.redis.connection.RedisZSetCommands;
import org.springframework.data.redis.connection.zset.Aggregate;
-import org.springframework.data.redis.connection.zset.DefaultTuple;
import org.springframework.data.redis.connection.zset.Tuple;
import org.springframework.data.redis.connection.zset.Weights;
import org.springframework.data.redis.core.Cursor;
@@ -42,11 +42,14 @@
import org.springframework.util.Assert;
/**
+ * {@link RedisZSetCommands} implementation for Jedis.
+ *
* @author Christoph Strobl
* @author Clement Ong
* @author Mark Paluch
* @author Andrey Shlykov
* @author Shyngys Sapraliyev
+ * @author John Blum
* @since 2.0
*/
class JedisZSetCommands implements RedisZSetCommands {
@@ -74,8 +77,10 @@ public Long zAdd(byte[] key, Set tuples, ZAddArgs args) {
Assert.notNull(key, "Key must not be null");
Assert.notNull(tuples, "Tuples must not be null");
- return connection.invoke().just(Jedis::zadd, PipelineBinaryCommands::zadd, key, JedisConverters.toTupleMap(tuples),
- JedisConverters.toZAddParams(args));
+ Long count = connection.invoke().just(Jedis::zadd, PipelineBinaryCommands::zadd, key,
+ JedisConverters.toTupleMap(tuples), JedisConverters.toZAddParams(args));
+
+ return count != null ? count : 0L;
}
@Override
@@ -424,7 +429,7 @@ public Set zDiff(byte[]... sets) {
Assert.notNull(sets, "Sets must not be null");
- return connection.invoke().just(Jedis::zdiff, PipelineBinaryCommands::zdiff, sets);
+ return connection.invoke().fromMany(Jedis::zdiff, PipelineBinaryCommands::zdiff, sets).toSet();
}
@Override
@@ -450,7 +455,7 @@ public Set zInter(byte[]... sets) {
Assert.notNull(sets, "Sets must not be null");
- return connection.invoke().just(Jedis::zinter, PipelineBinaryCommands::zinter, new ZParams(), sets);
+ return connection.invoke().fromMany(Jedis::zinter, PipelineBinaryCommands::zinter, new ZParams(), sets).toSet();
}
@Override
@@ -504,7 +509,7 @@ public Set zUnion(byte[]... sets) {
Assert.notNull(sets, "Sets must not be null");
- return connection.invoke().just(Jedis::zunion, PipelineBinaryCommands::zunion, new ZParams(), sets);
+ return connection.invoke().fromMany(Jedis::zunion, PipelineBinaryCommands::zunion, new ZParams(), sets).toSet();
}
@Override
@@ -772,21 +777,8 @@ static ZRangeParams toZRangeParams(Protocol.Keyword by, byte[] min, byte[] max,
return zRangeParams;
}
- /**
- * Workaround for broken Jedis BZPOP signature.
- *
- * @param bytes
- * @return
- */
@Nullable
- @SuppressWarnings("unchecked")
- private static Tuple toTuple(List> bytes) {
-
- if (bytes.isEmpty()) {
- return null;
- }
-
- return new DefaultTuple((byte[]) bytes.get(1), Double.parseDouble(new String((byte[]) bytes.get(2))));
+ private static Tuple toTuple(@Nullable KeyValue, redis.clients.jedis.resps.Tuple> keyValue) {
+ return keyValue != null ? JedisConverters.toTuple(keyValue.getValue()) : null;
}
-
}
diff --git a/src/main/java/org/springframework/data/redis/connection/zset/DefaultTuple.java b/src/main/java/org/springframework/data/redis/connection/zset/DefaultTuple.java
index eb2c198e8e..34e8e88454 100644
--- a/src/main/java/org/springframework/data/redis/connection/zset/DefaultTuple.java
+++ b/src/main/java/org/springframework/data/redis/connection/zset/DefaultTuple.java
@@ -18,23 +18,27 @@
import java.util.Arrays;
import org.springframework.lang.Nullable;
+import org.springframework.util.ObjectUtils;
/**
* Default implementation for {@link Tuple} interface.
*
* @author Costin Leau
* @author Christoph Strobl
+ * @author John Blum
*/
public class DefaultTuple implements Tuple {
+ private static final Double ZERO = 0.0d;
+
private final Double score;
private final byte[] value;
/**
- * Constructs a new DefaultTuple
instance.
+ * Constructs a new {@link DefaultTuple}.
*
- * @param value
- * @param score
+ * @param value {@link byte[]} of the member's raw value.
+ * @param score {@link Double score} of the raw value used in sorting.
*/
public DefaultTuple(byte[] value, Double score) {
@@ -43,29 +47,25 @@ public DefaultTuple(byte[] value, Double score) {
}
public Double getScore() {
- return score;
+ return this.score;
}
public byte[] getValue() {
- return value;
+ return this.value;
}
public boolean equals(@Nullable Object obj) {
- if (this == obj)
+
+ if (this == obj) {
return true;
- if (obj == null)
- return false;
- if (!(obj instanceof DefaultTuple))
- return false;
- DefaultTuple other = (DefaultTuple) obj;
- if (score == null) {
- if (other.score != null)
- return false;
- } else if (!score.equals(other.score))
- return false;
- if (!Arrays.equals(value, other.value))
+ }
+
+ if (!(obj instanceof DefaultTuple that)) {
return false;
- return true;
+ }
+
+ return ObjectUtils.nullSafeEquals(this.score, that.score)
+ && Arrays.equals(this.value, that.value);
}
public int hashCode() {
@@ -76,19 +76,21 @@ public int hashCode() {
return result;
}
- public int compareTo(Double o) {
- Double d = (score == null ? Double.valueOf(0.0d) : score);
- Double a = (o == null ? Double.valueOf(0.0d) : o);
- return d.compareTo(a);
+ public int compareTo(Double value) {
+
+ Double ourScore = getScore();
+ Double thisScore = ourScore != null ? ourScore : ZERO;
+ Double thatScore = value != null ? value : ZERO;
+
+ return thisScore.compareTo(thatScore);
}
@Override
public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append(getClass().getSimpleName());
- sb.append(" [score=").append(score);
- sb.append(", value=").append(value == null ? "null" : new String(value));
- sb.append(']');
- return sb.toString();
+
+ return getClass().getSimpleName()
+ + " { score=" + getScore()
+ + ", value=" + Arrays.toString(getValue())
+ + " }";
}
}
diff --git a/src/main/java/org/springframework/data/redis/connection/zset/Tuple.java b/src/main/java/org/springframework/data/redis/connection/zset/Tuple.java
index 19c05a3385..4f35b6c25f 100644
--- a/src/main/java/org/springframework/data/redis/connection/zset/Tuple.java
+++ b/src/main/java/org/springframework/data/redis/connection/zset/Tuple.java
@@ -20,6 +20,17 @@
*/
public interface Tuple extends Comparable {
+ /**
+ * Create a new {@link Tuple} with the {@link byte[] raw value} and given {@link Double score}.
+ *
+ * @param value {@link byte[]} of the member's raw value.
+ * @param score {@link Double score} given to the {@code value} used in sorting.
+ * @return a {@link Tuple} capturing the {@link byte[] value} with its {@link Double score}.
+ */
+ static Tuple of(byte[] value, Double score) {
+ return new DefaultTuple(value, score);
+ }
+
/**
* @return the raw value of the member.
*/
@@ -30,14 +41,4 @@ public interface Tuple extends Comparable {
*/
Double getScore();
- /**
- * Create a new {@link Tuple}.
- *
- * @param value
- * @param score
- * @return
- */
- static Tuple of(byte[] value, Double score) {
- return new DefaultTuple(value, score);
- }
}
diff --git a/src/main/java/org/springframework/data/redis/core/types/Expiration.java b/src/main/java/org/springframework/data/redis/core/types/Expiration.java
index c5df3ae8f7..d24a60fc89 100644
--- a/src/main/java/org/springframework/data/redis/core/types/Expiration.java
+++ b/src/main/java/org/springframework/data/redis/core/types/Expiration.java
@@ -16,7 +16,6 @@
package org.springframework.data.redis.core.types;
import java.time.Duration;
-import java.util.Objects;
import java.util.concurrent.TimeUnit;
import org.springframework.lang.Nullable;
diff --git a/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java b/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java
index b6b12293eb..bb07bd98e8 100644
--- a/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java
+++ b/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java
@@ -111,6 +111,8 @@
*/
public abstract class AbstractConnectionIntegrationTests {
+ private static final byte[] EMPTY_ARRAY = new byte[0];
+
private static final Point POINT_ARIGENTO = new Point(13.583333, 37.316667);
private static final Point POINT_CATANIA = new Point(15.087269, 37.502669);
private static final Point POINT_PALERMO = new Point(13.361389, 38.115556);
@@ -119,17 +121,18 @@ public abstract class AbstractConnectionIntegrationTests {
private static final GeoLocation CATANIA = new GeoLocation<>("catania", POINT_CATANIA);
private static final GeoLocation PALERMO = new GeoLocation<>("palermo", POINT_PALERMO);
- protected StringRedisConnection connection;
- protected RedisSerializer