Skip to content

Commit

Permalink
[EJBCLIENT-537] EJBClientInvocationContext: make the class compile on…
Browse files Browse the repository at this point in the history
… JDK21
  • Loading branch information
tadamski committed Jul 23, 2024
1 parent 4ada375 commit 2dbca72
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public final class EJBClientInvocationContext extends AbstractInvocationContext

private volatile boolean cancelRequested;
private boolean retryRequested;
private State state = State.SENDING;
private EJBClientInvocationContext.State state = EJBClientInvocationContext.State.SENDING;
private int remainingRetries;
private Supplier<? extends Throwable> pendingFailure;
private List<Supplier<? extends Throwable>> suppressedExceptions;
Expand Down Expand Up @@ -1082,7 +1082,7 @@ void retryOperation() {
} catch (Throwable t) {
final boolean retry;
synchronized (lock) {
retry = state == State.SENDING;
retry = state == EJBClientInvocationContext.State.SENDING;
}
if (retry) sendRequestInitial();
}
Expand All @@ -1097,7 +1097,7 @@ public boolean cancel(final boolean mayInterruptIfRunning) {
final Object lock = EJBClientInvocationContext.this.lock;
assert !holdsLock(lock);
synchronized (lock) {
if (state == State.DONE) {
if (state == EJBClientInvocationContext.State.DONE) {
// cannot cancel now; also resultProducer is gone
return pendingFailure == CANCELLED_PRODUCER;
} else if (! state.isWaiting()) {
Expand All @@ -1116,7 +1116,7 @@ public boolean cancel(final boolean mayInterruptIfRunning) {
final boolean result = receiver != null && receiver.cancelInvocation(receiverInvocationContext, mayInterruptIfRunning);
if (! result) {
synchronized (lock) {
if (resultProducer == CANCELLED || state == State.DONE && pendingFailure == CANCELLED_PRODUCER) {
if (resultProducer == CANCELLED || state == EJBClientInvocationContext.State.DONE && pendingFailure == CANCELLED_PRODUCER) {
return true;
}
}
Expand All @@ -1128,15 +1128,15 @@ public boolean isCancelled() {
final Object lock = EJBClientInvocationContext.this.lock;
assert !holdsLock(lock);
synchronized (lock) {
return state == State.DONE ? pendingFailure == CANCELLED_PRODUCER : resultProducer == CANCELLED;
return state == EJBClientInvocationContext.State.DONE ? pendingFailure == CANCELLED_PRODUCER : resultProducer == CANCELLED;
}
}

public boolean isDone() {
final Object lock = EJBClientInvocationContext.this.lock;
assert !holdsLock(lock);
synchronized (lock) {
if (state == State.CONSUMING) {
if (state == EJBClientInvocationContext.State.CONSUMING) {
return retryRequested && remainingRetries > 0 && resultProducer instanceof ThrowableResult;
} else {
// TODO: we should also calculate whether the invocation timed out
Expand Down

0 comments on commit 2dbca72

Please sign in to comment.