Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b5uFE41EgmSXEP4axJ
5 lines
376 B
Java
5 lines
376 B
Java
// The Java 21 preview shape (ShutdownOnFailure) does not exist in 25: this must fail to compile.
|
|
import java.util.concurrent.StructuredTaskScope;
|
|
public class ShutdownOnFailure21Style { public static void main(String[] a) throws Exception {
|
|
try (var s = new StructuredTaskScope.ShutdownOnFailure()) { var f = s.fork(() -> "x"); s.join(); System.out.println(f.get()); } } }
|