improve array check

This commit is contained in:
Costin Leau
2012-06-21 17:34:35 +03:00
parent 05c4d6c793
commit 68ef9bcb93
2 changed files with 4 additions and 5 deletions

View File

@@ -34,6 +34,7 @@ import org.springframework.data.redis.connection.RedisSubscribedConnectionExcept
import org.springframework.data.redis.connection.SortParameters;
import org.springframework.data.redis.connection.Subscription;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import org.springframework.util.ReflectionUtils;
import redis.clients.jedis.BinaryJedis;
@@ -135,10 +136,7 @@ public class JedisConnection implements RedisConnection {
public Object execute(String command, byte[]... args) {
Assert.hasText(command, "a valid command needs to be specified");
List<byte[]> mArgs = new ArrayList<byte[]>();
if (args == null) {
mArgs.add(new byte[0]);
}
else {
if (!ObjectUtils.isEmpty(args)) {
Collections.addAll(mArgs, args);
}

View File

@@ -41,6 +41,7 @@ import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.connection.SortParameters;
import org.springframework.data.redis.connection.Subscription;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import org.springframework.util.ReflectionUtils;
/**
@@ -89,7 +90,7 @@ public class JredisConnection implements RedisConnection {
public Object execute(String command, byte[]... args) {
Assert.hasText(command, "a valid command needs to be specified");
List<byte[]> mArgs = new ArrayList<byte[]>();
if (args != null) {
if (!ObjectUtils.isEmpty(args)) {
Collections.addAll(mArgs, args);
}