Skip to content

Commit 2dd03fc

Browse files
committed
egg7 Java 25
1 parent cc26ade commit 2dd03fc

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

2025-09-JDK-25-list.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@
88
- ok for bash, Maven
99
- egg6
1010
- ok for bash, Maven
11+
- egg7
12+
- ok for bash, Maven

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
package net.codetojoy;
44

55
import java.time.*;
6+
import java.util.List;
67
import java.util.concurrent.StructuredTaskScope;
8+
import java.util.concurrent.StructuredTaskScope.Joiner;
9+
import java.util.concurrent.StructuredTaskScope.Subtask;
710

811
public class Runner {
912
long taskFooDelayInMillis = 20000L;
@@ -30,14 +33,14 @@ String taskBar() {
3033
}
3134

3235
String run() throws Exception {
33-
try (var scope = new StructuredTaskScope.ShutdownOnSuccess<String>()) {
36+
Duration timeout = Duration.ofSeconds(2);
37+
38+
try (var scope = StructuredTaskScope.open(Joiner.<String>anySuccessfulResultOrThrow(),
39+
cf -> cf.withTimeout(timeout))) {
3440
var foo = scope.fork(() -> taskFoo());
3541
var bar = scope.fork(() -> taskBar());
3642

37-
var deadline = Instant.now().plusSeconds(2);
38-
scope.joinUntil(deadline);
39-
40-
return scope.result();
43+
return scope.join();
4144
}
4245
}
4346

0 commit comments

Comments
 (0)