Consistently use while (true) instead of for (;;) across the codebase

This commit is contained in:
Sam Brannen
2026-09-14 18:15:02 +02:00
parent c1aa1b7405
commit 3178df92bd
5 changed files with 9 additions and 9 deletions
@@ -169,7 +169,7 @@ final class SubscriberInputStream extends InputStream implements Subscriber<Data
}
int addWork() {
for (;;) {
while (true) {
int produced = this.workAmount.getPlain();
if (produced == Integer.MIN_VALUE) {
@@ -297,7 +297,7 @@ final class SubscriberInputStream extends InputStream implements Subscriber<Data
this.available = null;
int actualWorkAmount = this.workAmount.getAcquire();
for (;;) {
while (true) {
if (this.closed) {
return CLOSED;
}
@@ -332,7 +332,7 @@ final class SubscriberInputStream extends InputStream implements Subscriber<Data
discard(this.available);
this.available = null;
for (;;) {
while (true) {
int workAmount = this.workAmount.getPlain();
DataBuffer value;
while ((value = this.queue.poll()) != null) {
@@ -203,7 +203,7 @@ public final class ConcurrentLruCache<K, V> {
* current size of the cache, unless the node has already been removed.
*/
private void markAsRemoved(Node<K, V> node) {
for (; ; ) {
while (true) {
CacheEntry<V> current = node.get();
if (current.state == CacheEntryState.REMOVED) {
return;
@@ -89,7 +89,7 @@ public class OrderedMessageChannelDecorator implements MessageChannel {
}
private void sendNextMessage() {
for (;;) {
while (true) {
Message<?> message = this.messages.peek();
if (message != null) {
try {
@@ -190,7 +190,7 @@ final class SubscriberInputStream<T> extends InputStream implements Flow.Subscri
}
int addWork() {
for (;;) {
while (true) {
int produced = this.workAmount.getPlain();
if (produced == Integer.MIN_VALUE) {
@@ -319,7 +319,7 @@ final class SubscriberInputStream<T> extends InputStream implements Flow.Subscri
this.available = null;
int actualWorkAmount = this.workAmount.getAcquire();
for (;;) {
while (true) {
if (this.closed) {
return CLOSED;
}
@@ -354,7 +354,7 @@ final class SubscriberInputStream<T> extends InputStream implements Flow.Subscri
void cleanAndFinalize() {
this.available = null;
for (;;) {
while (true) {
int workAmount = this.workAmount.getPlain();
T value;
while ((value = this.queue.poll()) != null) {
@@ -180,7 +180,7 @@ public abstract class AbstractListenerWriteProcessor<T> implements Processor<T,
*/
void cancelAndSetCompleted() {
cancel();
for (;;) {
while (true) {
State prev = this.state.get();
if (prev == State.COMPLETED) {
break;