Skip to content

Commit 9134d15

Browse files
author
Alexandru Scvortov
committed
refactor
1 parent e7ef40d commit 9134d15

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,16 @@ public boolean waitForConfirms()
191191
throws InterruptedException
192192
{
193193
synchronized (unconfirmedSet) {
194-
while ((unconfirmedSet.size() > 0) && (getCloseReason() == null))
194+
while (true) {
195+
if (getCloseReason() != null) {
196+
throw Utility.fixStackTrace(getCloseReason());
197+
}
198+
if (unconfirmedSet.isEmpty()) {
199+
boolean noNacksReceived = !nacksReceived;
200+
nacksReceived = false;
201+
return noNacksReceived;
202+
}
195203
unconfirmedSet.wait();
196-
if (unconfirmedSet.isEmpty()) {
197-
boolean noNacksReceived = !nacksReceived;
198-
nacksReceived = false;
199-
return noNacksReceived;
200-
} else {
201-
throw Utility.fixStackTrace(getCloseReason());
202204
}
203205
}
204206
}

0 commit comments

Comments
 (0)