+ remove generified vargs signature from public interface
This commit is contained in:
@@ -52,7 +52,7 @@ public interface RedisOperations<K, V> {
|
||||
|
||||
long getExpire(K key);
|
||||
|
||||
void watch(K... keys);
|
||||
void watch(Collection<K> keys);
|
||||
|
||||
void multi();
|
||||
|
||||
|
||||
@@ -689,7 +689,7 @@ public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperation
|
||||
}
|
||||
|
||||
@Override
|
||||
public void watch(K... keys) {
|
||||
public void watch(Collection<K> keys) {
|
||||
final byte[][] rawKeys = rawKeys(keys);
|
||||
|
||||
execute(new RedisCallback<Object>() {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
package org.springframework.data.keyvalue.redis.util;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
|
||||
import org.springframework.data.keyvalue.redis.core.RedisOperations;
|
||||
import org.springframework.data.keyvalue.redis.core.ValueOperations;
|
||||
@@ -95,7 +96,7 @@ public class RedisAtomicInteger extends Number implements Serializable {
|
||||
*/
|
||||
public boolean compareAndSet(int expect, int update) {
|
||||
for (;;) {
|
||||
generalOps.watch(key);
|
||||
generalOps.watch(Collections.singleton(key));
|
||||
if (expect == get()) {
|
||||
generalOps.multi();
|
||||
set(update);
|
||||
@@ -115,7 +116,7 @@ public class RedisAtomicInteger extends Number implements Serializable {
|
||||
*/
|
||||
public int getAndIncrement() {
|
||||
for (;;) {
|
||||
generalOps.watch(key);
|
||||
generalOps.watch(Collections.singleton(key));
|
||||
int value = get();
|
||||
generalOps.multi();
|
||||
operations.increment(key, 1);
|
||||
@@ -132,7 +133,7 @@ public class RedisAtomicInteger extends Number implements Serializable {
|
||||
*/
|
||||
public int getAndDecrement() {
|
||||
for (;;) {
|
||||
generalOps.watch(key);
|
||||
generalOps.watch(Collections.singleton(key));
|
||||
int value = get();
|
||||
generalOps.multi();
|
||||
operations.increment(key, -1);
|
||||
@@ -150,7 +151,7 @@ public class RedisAtomicInteger extends Number implements Serializable {
|
||||
*/
|
||||
public int getAndAdd(int delta) {
|
||||
for (;;) {
|
||||
generalOps.watch(key);
|
||||
generalOps.watch(Collections.singleton(key));
|
||||
int value = get();
|
||||
generalOps.multi();
|
||||
set(value + delta);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
package org.springframework.data.keyvalue.redis.util;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
|
||||
import org.springframework.data.keyvalue.redis.core.RedisOperations;
|
||||
import org.springframework.data.keyvalue.redis.core.ValueOperations;
|
||||
@@ -95,7 +96,7 @@ public class RedisAtomicLong extends Number implements Serializable {
|
||||
*/
|
||||
public boolean compareAndSet(long expect, long update) {
|
||||
for (;;) {
|
||||
generalOps.watch(key);
|
||||
generalOps.watch(Collections.singleton(key));
|
||||
if (expect == get()) {
|
||||
generalOps.multi();
|
||||
set(update);
|
||||
@@ -116,7 +117,7 @@ public class RedisAtomicLong extends Number implements Serializable {
|
||||
*/
|
||||
public long getAndIncrement() {
|
||||
for (;;) {
|
||||
generalOps.watch(key);
|
||||
generalOps.watch(Collections.singleton(key));
|
||||
long value = get();
|
||||
generalOps.multi();
|
||||
operations.increment(key, 1);
|
||||
@@ -133,7 +134,7 @@ public class RedisAtomicLong extends Number implements Serializable {
|
||||
*/
|
||||
public long getAndDecrement() {
|
||||
for (;;) {
|
||||
generalOps.watch(key);
|
||||
generalOps.watch(Collections.singleton(key));
|
||||
long value = get();
|
||||
generalOps.multi();
|
||||
operations.increment(key, -1);
|
||||
@@ -151,7 +152,7 @@ public class RedisAtomicLong extends Number implements Serializable {
|
||||
*/
|
||||
public long getAndAdd(long delta) {
|
||||
for (;;) {
|
||||
generalOps.watch(key);
|
||||
generalOps.watch(Collections.singleton(key));
|
||||
long value = get();
|
||||
generalOps.multi();
|
||||
set(value + delta);
|
||||
|
||||
Reference in New Issue
Block a user