Skip to content

Commit

Permalink
Merge branch '3.2.x' into 3.3.x
Browse files Browse the repository at this point in the history
Closes gh-41504
  • Loading branch information
wilkinsona committed Jul 15, 2024
2 parents b77b543 + d63e3c3 commit 999d99e
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,6 +29,7 @@
import org.springframework.core.annotation.Order;
import org.springframework.core.type.AnnotatedTypeMetadata;
import org.springframework.util.MultiValueMap;
import org.springframework.util.ReflectionUtils;
import org.springframework.util.StringUtils;

/**
Expand Down Expand Up @@ -142,8 +143,17 @@ private static final class ThreadedOutcomesResolver implements OutcomesResolver

private volatile ConditionOutcome[] outcomes;

private volatile Throwable failure;

private ThreadedOutcomesResolver(OutcomesResolver outcomesResolver) {
this.thread = new Thread(() -> this.outcomes = outcomesResolver.resolveOutcomes());
this.thread = new Thread(() -> {
try {
this.outcomes = outcomesResolver.resolveOutcomes();
}
catch (Throwable ex) {
this.failure = ex;
}
});
this.thread.start();
}

Expand All @@ -155,6 +165,9 @@ public ConditionOutcome[] resolveOutcomes() {
catch (InterruptedException ex) {
Thread.currentThread().interrupt();
}
if (this.failure != null) {
ReflectionUtils.rethrowRuntimeException(this.failure);
}
return this.outcomes;
}

Expand Down

0 comments on commit 999d99e

Please sign in to comment.