Skip to content

Commit b18e3ce

Browse files
committed
egg 5 for Java 25
1 parent 09cb1d9 commit b18e3ce

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

2025-09-JDK-25-list.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
3+
- key page: https://download.java.net/java/early_access/jdk25/docs/api/java.base/java/util/concurrent/StructuredTaskScope.Joiner.html
4+
5+
- Gradle: not yet
6+
7+
- egg5
8+
- ok for bash, Maven

egg_5_sc_invoke_all/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_5_sc_invoke_all/pom.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
<properties>
1515
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16-
<maven.compiler.source>19</maven.compiler.source>
17-
<maven.compiler.target>19</maven.compiler.target>
16+
<maven.compiler.source>25</maven.compiler.source>
17+
<maven.compiler.target>25</maven.compiler.target>
1818
</properties>
1919

2020
<dependencies>
@@ -45,7 +45,6 @@
4545
<configuration>
4646
<compilerArgs>
4747
<arg>--enable-preview</arg>
48-
<arg>--add-modules=jdk.incubator.concurrent</arg>
4948
</compilerArgs>
5049
</configuration>
5150
</plugin>
@@ -82,7 +81,6 @@
8281
<configuration>
8382
<executable>${java.home}/bin/java</executable>
8483
<arguments>
85-
<argument>--add-modules=jdk.incubator.concurrent</argument>
8684
<argument>--enable-preview</argument>
8785
<argument>--class-path</argument>
8886
<classpath/>

egg_5_sc_invoke_all/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_5_sc_invoke_all/src/main/java/net/codetojoy/Runner.java

Lines changed: 2 additions & 2 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
long taskFooDelayInMillis = 1000L;
@@ -30,12 +31,11 @@ String taskBar() {
3031
}
3132

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

3738
scope.join(); // Join both forks
38-
scope.throwIfFailed(); // and propagate errors
3939

4040
// Here, both forks have succeeded, so compose their results
4141
return foo.get() + " " + bar.get();

0 commit comments

Comments
 (0)