ARTEMIS-2320 'while' statement does not loop
This commit is contained in:
parent
b33874488b
commit
781e4c460d
|
@ -3748,16 +3748,12 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
|
|||
}
|
||||
|
||||
}
|
||||
while (true) {
|
||||
if (messagesIterator != null && messagesIterator.hasNext()) {
|
||||
MessageReference msg = messagesIterator.next();
|
||||
if (msg.isPaged()) {
|
||||
previouslyBrowsed.add(((PagedReference) msg).getPosition());
|
||||
}
|
||||
return msg;
|
||||
} else {
|
||||
break;
|
||||
if (messagesIterator != null && messagesIterator.hasNext()) {
|
||||
MessageReference msg = messagesIterator.next();
|
||||
if (msg.isPaged()) {
|
||||
previouslyBrowsed.add(((PagedReference) msg).getPosition());
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
if (getPagingIterator() != null) {
|
||||
while (getPagingIterator().hasNext()) {
|
||||
|
|
|
@ -48,16 +48,14 @@ public class SpawnedJMSServer {
|
|||
|
||||
System.out.println("OK");
|
||||
|
||||
String line = null;
|
||||
while ((line = br.readLine()) != null) {
|
||||
if ("STOP".equals(line.trim())) {
|
||||
stopServer();
|
||||
System.out.println("Server stopped");
|
||||
System.exit(0);
|
||||
} else {
|
||||
// stop anyway but with an error status
|
||||
System.exit(1);
|
||||
}
|
||||
String line = br.readLine();
|
||||
if (line != null && "STOP".equals(line.trim())) {
|
||||
stopServer();
|
||||
System.out.println("Server stopped");
|
||||
System.exit(0);
|
||||
} else {
|
||||
// stop anyway but with an error status
|
||||
System.exit(1);
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
|
|
Loading…
Reference in New Issue