Skip to content

Commit 7a7f2d6

Browse files
author
Steve Powell
committed
Rename FOREVER constant to NO_TIMEOUT
1 parent 740042d commit 7a7f2d6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/com/rabbitmq/client/RpcClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ public class RpcClient {
4848
private final String _routingKey;
4949
/** timeout to use on call responses */
5050
private final int _timeout;
51-
/** FOREVER value must match convention on {@link BlockingCell#uninterruptibleGet(int)} */
52-
protected final static int FOREVER = -1;
51+
/** NO_TIMEOUT value must match convention on {@link BlockingCell#uninterruptibleGet(int)} */
52+
protected final static int NO_TIMEOUT = -1;
5353

5454
/** Map from request correlation ID to continuation BlockingCell */
5555
private final Map<String, BlockingCell<Object>> _continuationMap = new HashMap<String, BlockingCell<Object>>();
@@ -77,7 +77,7 @@ public RpcClient(Channel channel, String exchange, String routingKey, int timeou
7777
_channel = channel;
7878
_exchange = exchange;
7979
_routingKey = routingKey;
80-
if (timeout < FOREVER) throw new IllegalArgumentException("Timeout must be -1 or greater.");
80+
if (timeout < NO_TIMEOUT) throw new IllegalArgumentException("Timeout arguument must be NO_TIMEOUT(-1) or non-negative.");
8181
_timeout = timeout;
8282
_correlationId = 0;
8383

@@ -99,7 +99,7 @@ public RpcClient(Channel channel, String exchange, String routingKey, int timeou
9999
* @see #setupReplyQueue
100100
*/
101101
public RpcClient(Channel channel, String exchange, String routingKey) throws IOException {
102-
this(channel, exchange, routingKey, FOREVER);
102+
this(channel, exchange, routingKey, NO_TIMEOUT);
103103
}
104104

105105
/**

src/com/rabbitmq/tools/jsonrpc/JsonRpcClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public JsonRpcClient(Channel channel, String exchange, String routingKey, int ti
7676
public JsonRpcClient(Channel channel, String exchange, String routingKey)
7777
throws IOException, JsonRpcException, TimeoutException
7878
{
79-
this(channel, exchange, routingKey, RpcClient.FOREVER);
79+
this(channel, exchange, routingKey, RpcClient.NO_TIMEOUT);
8080
}
8181

8282
/**

0 commit comments

Comments
 (0)