Skip to content

Commit 75ddf6f

Browse files
committed
egg6 Java 25
1 parent b18e3ce commit 75ddf6f

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

2025-09-JDK-25-list.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@
66

77
- egg5
88
- ok for bash, Maven
9+
- egg6
10+
- ok for bash, Maven

egg_6_sc_invoke_any/compile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ TARGET_DIR=$ROOT_DIR/my_build/main
1010

1111
mkdir -p $TARGET_DIR
1212

13-
javac --release 21 --enable-preview \
13+
javac --release 25 --enable-preview \
1414
-cp $CLASSPATH \
1515
-d $TARGET_DIR `find $SRC_DIR -name "*.java"`
1616

egg_6_sc_invoke_any/run.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ CLASSPATH=$CLASSPATH:$TARGET_DIR
99

1010
java --enable-preview \
1111
-cp $CLASSPATH \
12-
--add-modules jdk.incubator.concurrent \
1312
net.codetojoy.Runner
1413

1514
echo "run complete"

egg_6_sc_invoke_any/src/main/java/net/codetojoy/Runner.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import java.time.Duration;
66
import java.util.concurrent.*;
7+
import java.util.concurrent.StructuredTaskScope.Joiner;
78

89
public class Runner {
910
int taskFooDelayInMillis = 2000;
@@ -30,13 +31,11 @@ String taskBar() {
3031
}
3132

3233
String run() throws Exception {
33-
try (var scope = new StructuredTaskScope.ShutdownOnSuccess<String>()) {
34+
try (var scope = StructuredTaskScope.open(Joiner.<String>anySuccessfulResultOrThrow())) {
3435
var foo = scope.fork(() -> taskFoo());
3536
var bar = scope.fork(() -> taskBar());
3637

37-
scope.join();
38-
39-
return scope.result();
38+
return scope.join();
4039
}
4140
}
4241

0 commit comments

Comments
 (0)