Skip to content

Commit 18eacc8

Browse files
committed
compiles with jdk 21 up to egg 8
1 parent 1bd7069 commit 18eacc8

File tree

14 files changed

+21
-39
lines changed

14 files changed

+21
-39
lines changed

build-all.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ cd $MY_HOME/egg_7_sc_deadline
2828
cd $MY_HOME/egg_8_sc_custom_invoke_some
2929
./clean.sh && ./compile.sh
3030

31+
exit 0
32+
3133
cd $MY_HOME/egg_9_sc_fan_in/client
3234
./clean.sh && ./compile.sh
3335

egg_1_max_p_threads/compile.sh

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

1111
mkdir -p $TARGET_DIR
1212

13-
javac --release 19 --enable-preview \
14-
-cp $CLASSPATH \
13+
javac -cp $CLASSPATH \
1514
-d $TARGET_DIR `find $SRC_DIR -name "*.java"`
1615

1716
echo "compile ok"

egg_2_max_v_threads/compile.sh

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

1111
mkdir -p $TARGET_DIR
1212

13-
javac --release 19 --enable-preview \
14-
-cp $CLASSPATH \
13+
javac -cp $CLASSPATH \
1514
-d $TARGET_DIR `find $SRC_DIR -name "*.java"`
1615

1716
echo "compile ok"

egg_3_legacy_exec/compile.sh

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

1111
mkdir -p $TARGET_DIR
1212

13-
javac --release 19 --enable-preview \
14-
-cp $CLASSPATH \
13+
javac -cp $CLASSPATH \
1514
-d $TARGET_DIR `find $SRC_DIR -name "*.java"`
1615

1716
echo "compile ok"

egg_4_virtual_exec/compile.sh

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

1111
mkdir -p $TARGET_DIR
1212

13-
javac --release 19 --enable-preview \
14-
-cp $CLASSPATH \
13+
javac -cp $CLASSPATH \
1514
-d $TARGET_DIR `find $SRC_DIR -name "*.java"`
1615

1716
echo "compile ok"

egg_5_sc_invoke_all/compile.sh

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

1111
mkdir -p $TARGET_DIR
1212

13-
javac --release 19 --enable-preview \
13+
javac --release 21 --enable-preview \
1414
-cp $CLASSPATH \
15-
--add-modules jdk.incubator.concurrent \
1615
-d $TARGET_DIR `find $SRC_DIR -name "*.java"`
1716

1817
echo "compile ok"

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

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

55
import java.time.Duration;
66
import java.util.concurrent.*;
7-
import jdk.incubator.concurrent.*;
8-
9-
// javadoc here: https://download.java.net/java/early_access/jdk19/docs/api/jdk.incubator.concurrent/jdk/incubator/concurrent/package-summary.html
107

118
public class Runner {
129
long taskFooDelayInMillis = 1000L;
@@ -34,14 +31,14 @@ String taskBar() {
3431

3532
String run() throws Exception {
3633
try (var scope = new StructuredTaskScope.ShutdownOnFailure()) {
37-
Future<String> foo = scope.fork(() -> taskFoo());
38-
Future<String> bar = scope.fork(() -> taskBar());
34+
var foo = scope.fork(() -> taskFoo());
35+
var bar = scope.fork(() -> taskBar());
3936

4037
scope.join(); // Join both forks
4138
scope.throwIfFailed(); // and propagate errors
4239

4340
// Here, both forks have succeeded, so compose their results
44-
return foo.resultNow() + " " + bar.resultNow();
41+
return foo.get() + " " + bar.get();
4542
}
4643
}
4744

egg_6_sc_invoke_any/compile.sh

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

1111
mkdir -p $TARGET_DIR
1212

13-
javac --release 19 --enable-preview \
13+
javac --release 21 --enable-preview \
1414
-cp $CLASSPATH \
15-
--add-modules jdk.incubator.concurrent \
1615
-d $TARGET_DIR `find $SRC_DIR -name "*.java"`
1716

1817
echo "compile ok"

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
package net.codetojoy;
44

55
import java.time.Duration;
6-
import jdk.incubator.concurrent.*;
7-
8-
// javadoc here: https://download.java.net/java/early_access/jdk19/docs/api/jdk.incubator.concurrent/jdk/incubator/concurrent/package-summary.html
6+
import java.util.concurrent.*;
97

108
public class Runner {
119
int taskFooDelayInMillis = 2000;

egg_7_sc_deadline/compile.sh

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

1111
mkdir -p $TARGET_DIR
1212

13-
javac --release 19 --enable-preview \
13+
javac --release 21 --enable-preview \
1414
-cp $CLASSPATH \
15-
--add-modules jdk.incubator.concurrent \
1615
-d $TARGET_DIR `find $SRC_DIR -name "*.java"`
1716

1817
echo "compile ok"

0 commit comments

Comments
 (0)