DATAREDIS-843 - Polishing.

Remove unnecessary unboxing and final keywords from arguments in method signatures.

Original Pull Request: #349
This commit is contained in:
Mark Paluch
2018-06-27 11:44:24 +02:00
committed by Christoph Strobl
parent 191244b1a4
commit a0d8b3a4c6
3 changed files with 10 additions and 10 deletions

View File

@@ -150,7 +150,7 @@ public class RedisAtomicDouble extends Number implements Serializable, BoundKeyO
Double value = operations.get(key);
if (value != null) {
return value.doubleValue();
return value;
}
throw new DataRetrievalFailureException(String.format("The key '%s' seems to no longer exist.", key));
@@ -175,7 +175,7 @@ public class RedisAtomicDouble extends Number implements Serializable, BoundKeyO
Double value = operations.getAndSet(key, newValue);
return value != null ? value.doubleValue() : 0;
return value != null ? value : 0;
}
/**
@@ -186,7 +186,7 @@ public class RedisAtomicDouble extends Number implements Serializable, BoundKeyO
* @return {@literal true} if successful. {@literal false} indicates that the actual value was not equal to the
* expected value.
*/
public boolean compareAndSet(final double expect, final double update) {
public boolean compareAndSet(double expect, double update) {
return generalOps.execute(new CompareAndSet<>(this::get, this::set, key, expect, update));
}
@@ -214,7 +214,7 @@ public class RedisAtomicDouble extends Number implements Serializable, BoundKeyO
* @param delta the value to add
* @return the previous value
*/
public double getAndAdd(final double delta) {
public double getAndAdd(double delta) {
return addAndGet(delta) - delta;
}

View File

@@ -148,7 +148,7 @@ public class RedisAtomicInteger extends Number implements Serializable, BoundKey
Integer value = operations.get(key);
if (value != null) {
return value.intValue();
return value;
}
throw new DataRetrievalFailureException(String.format("The key '%s' seems to no longer exist.", key));
@@ -173,7 +173,7 @@ public class RedisAtomicInteger extends Number implements Serializable, BoundKey
Integer value = operations.getAndSet(key, newValue);
return value != null ? value.intValue() : 0;
return value != null ? value : 0;
}
/**
@@ -212,7 +212,7 @@ public class RedisAtomicInteger extends Number implements Serializable, BoundKey
* @param delta the value to add.
* @return the previous value.
*/
public int getAndAdd(final int delta) {
public int getAndAdd(int delta) {
return addAndGet(delta) - delta;
}

View File

@@ -155,7 +155,7 @@ public class RedisAtomicLong extends Number implements Serializable, BoundKeyOpe
Long value = operations.get(key);
if (value != null) {
return value.longValue();
return value;
}
throw new DataRetrievalFailureException(String.format("The key '%s' seems to no longer exist.", key));
@@ -180,7 +180,7 @@ public class RedisAtomicLong extends Number implements Serializable, BoundKeyOpe
Long value = operations.getAndSet(key, newValue);
return value != null ? value.longValue() : 0;
return value != null ? value : 0;
}
/**
@@ -219,7 +219,7 @@ public class RedisAtomicLong extends Number implements Serializable, BoundKeyOpe
* @param delta the value to add.
* @return the previous value.
*/
public long getAndAdd(final long delta) {
public long getAndAdd(long delta) {
return addAndGet(delta) - delta;
}