+ change exec return type to List<Object>

This commit is contained in:
Costin Leau
2011-03-15 23:42:31 +02:00
parent bb236634f0
commit 0523430a45
6 changed files with 9 additions and 14 deletions

View File

@@ -116,7 +116,7 @@ public class DefaultStringRedisConnection implements StringRedisConnection {
return delegate.echo(message);
}
public List<byte[]> exec() {
public List<Object> exec() {
return delegate.exec();
}

View File

@@ -27,7 +27,7 @@ public interface RedisTxCommands {
void multi();
List<byte[]> exec();
List<Object> exec();
void discard();

View File

@@ -511,19 +511,14 @@ public class JedisConnection implements RedisConnection {
}
}
@SuppressWarnings("unchecked")
@Override
public List<byte[]> exec() {
public List<Object> exec() {
try {
if (isPipelined()) {
pipeline.exec();
return null;
}
List execute = transaction.exec();
if (execute != null && !execute.isEmpty()) {
return (List<byte[]>) execute;
}
return Collections.emptyList();
return transaction.exec();
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}

View File

@@ -267,7 +267,7 @@ public class JredisConnection implements RedisConnection {
}
@Override
public List<byte[]> exec() {
public List<Object> exec() {
throw new UnsupportedOperationException();
}

View File

@@ -112,7 +112,7 @@ public interface RedisOperations<K, V> {
void discard();
Object exec();
List<Object> exec();
// pubsub functionality on the template
void convertAndSend(String destination, Object message);

View File

@@ -419,11 +419,11 @@ public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperation
// RedisOperations
//
@Override
public Object exec() {
return execute(new RedisCallback<Object>() {
public List<Object> exec() {
return execute(new RedisCallback<List<Object>>() {
@Override
public Object doInRedis(RedisConnection connection) throws DataAccessException {
public List<Object> doInRedis(RedisConnection connection) throws DataAccessException {
return connection.exec();
}
});