The finalized Structured Concurrency API, delivered through JEP 543, brings the StructuredTaskScope in java.util.concurrent to final status with no API changes from JDK 27's seventh preview. For codebases already on JDK 27, the migration comes down to recompiling without --enable-preview.
Structured concurrency debuted as an incubator API in JEP 428 (JDK 19) and JEP 437 (JDK 20), then progressed through seven previews from JDK 21 to JDK 27. Across every iteration, the core objective has been to treat groups of related subtasks running in different threads as a single unit of work, ensuring that a failure in one subtask cancels the others and that the parent scope cannot exit before all child threads have terminated. Traditional ExecutorService and Future pipelines do not enforce those boundaries.
The API centers on StructuredTaskScope, a sealed interface opened through static factory methods. The open() factory returns a scope where join() waits for all subtasks to succeed, cancels the rest on the first failure, and throws ExecutionException. Each fork() call starts a virtual thread by default. Completion policies are defined through the Joiner interface, offering policies such as allSuccessfulOrThrow, anySuccessfulOrThrow, and allUntil. Custom policies allow developers to surface application-specific checked exceptions directly from join().
The API is strict about structure: only the thread that opened the scope can call fork() and join(), results are read through Subtask.get() only after join() returns, and structural misuse fails fast with StructureViolationException. Subtasks inherit ScopedValue bindings from JEP 506 and appear under their parent in JSON thread dumps.
Teams coming from JDK 26 face more changes, including the replacement of FailedException with ExecutionException and removal of StructuredTaskScope.TimeoutException. The onTimeout() callback has been replaced by an abstract timeout() method.
The finalization commit only removes preview annotations and changes no method signatures. JDK 28 is scheduled for general availability in March 2027. The velo/structured-concurrency project already backports the JEP 543 API to JDK 25 and provides migration recipes.