Skip to content

Commit 187119d

Browse files
author
Emile Joubert
committed
Use less state
1 parent 91fcf04 commit 187119d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/com/rabbitmq/client/impl/ChannelN.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ public class ChannelN extends AMQChannel implements com.rabbitmq.client.Channel
8383
/** Sequence number of next published message requiring confirmation.*/
8484
private long nextPublishSeqNo = 0L;
8585

86-
private volatile boolean confirmSelected = false;
87-
8886
/** The current default consumer, or null if there is none. */
8987
private volatile Consumer defaultConsumer = null;
9088

@@ -177,7 +175,7 @@ public boolean waitForConfirms()
177175
/** {@inheritDoc} */
178176
public boolean waitForConfirms(long timeout)
179177
throws InterruptedException, TimeoutException {
180-
if (!confirmSelected)
178+
if (nextPublishSeqNo == 0L)
181179
throw new IllegalStateException("Confirms not selected");
182180
long startTime = System.currentTimeMillis();
183181
synchronized (unconfirmedSet) {
@@ -1052,7 +1050,6 @@ public Tx.RollbackOk txRollback()
10521050
public Confirm.SelectOk confirmSelect()
10531051
throws IOException
10541052
{
1055-
confirmSelected = true;
10561053
if (nextPublishSeqNo == 0) nextPublishSeqNo = 1;
10571054
return (Confirm.SelectOk)
10581055
exnWrappingRpc(new Confirm.Select(false)).getMethod();

0 commit comments

Comments
 (0)