Shadow client field from PipelineBlock and TransactionBlock
* it prevent from user accessing BinaryClient, while it is not treated to pipeline command ** it could make troubles when reading responses
This commit is contained in:
@@ -2,5 +2,9 @@ package redis.clients.jedis;
|
||||
|
||||
|
||||
public abstract class PipelineBlock extends Pipeline {
|
||||
// For shadowing
|
||||
@SuppressWarnings("unused")
|
||||
private Client client;
|
||||
|
||||
public abstract void execute();
|
||||
}
|
||||
|
||||
@@ -76,4 +76,8 @@ public class Transaction extends MultiKeyPipelineBase {
|
||||
return client.getStatusCodeReply();
|
||||
}
|
||||
|
||||
public void setClient(Client client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,6 +3,10 @@ package redis.clients.jedis;
|
||||
import redis.clients.jedis.exceptions.JedisException;
|
||||
|
||||
public abstract class TransactionBlock extends Transaction {
|
||||
// For shadowing
|
||||
@SuppressWarnings("unused")
|
||||
private Client client;
|
||||
|
||||
public TransactionBlock(Client client) {
|
||||
super(client);
|
||||
}
|
||||
@@ -13,6 +17,10 @@ public abstract class TransactionBlock extends Transaction {
|
||||
public abstract void execute() throws JedisException;
|
||||
|
||||
public void setClient(Client client) {
|
||||
this.client = client;
|
||||
super.setClient(client);
|
||||
}
|
||||
|
||||
public String discard() {
|
||||
return super.discard();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user