Java 27 and 26: runnable demos and captured output for every JEP, plus version lanes

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01B38FGKKam5SCGgwgduVAh3
This commit is contained in:
2026-09-21 15:08:50 +00:00
committed by Claude
co-authored by Claude Sonnet 5
commit f59c1de96d
152 changed files with 5049 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Runs the five JDK 27 feature demos on a real JDK 27. Every demo asserts its own claims (see Check.java),
# so a green transcript means the sentence in the post is still true.
# ./scripts/jep-tour.sh -> docs/output/21-structured.txt 22-lazy.txt 23-primitive-patterns.txt 24-pem.txt 25-vector.txt
set -uo pipefail
source "$(dirname "$0")/env.sh"
S="$ROOT/jep-tour/src"; B="$ROOT/build/tour"; rm -rf "$B"; mkdir -p "$B"
"$JDK27/bin/javac" --enable-preview --release 27 -Xlint:-preview -d "$B" "$S/Check.java" "$S/StructuredDemo.java" "$S/LazyDemo.java" \
"$S/PrimitivePatterns.java" "$S/PemDemo.java" 2>&1 | grep -v '^Note:' || true
"$JDK27/bin/javac" --add-modules jdk.incubator.vector --release 27 -d "$B" "$S/Check.java" "$S/VectorDemo.java" 2>&1 | grep -v -E '^(Note:|WARNING)' || true
run() { local name="$1" cls="$2"; shift 2
{ echo "\$ java $* $cls (JDK 27)"; "$JDK27/bin/java" -Dstdout.encoding=UTF-8 "$@" -cp "$B" "$cls" 2>&1 | grep -v '^WARNING: Using incubator'; echo "exit=${PIPESTATUS[0]}"; } > "$OUT/$name" 2>&1; }
run 21-structured.txt StructuredDemo --enable-preview
run 22-lazy.txt LazyDemo --enable-preview
run 23-primitive-patterns.txt PrimitivePatterns --enable-preview
run 24-pem.txt PemDemo --enable-preview
run 25-vector.txt VectorDemo --add-modules jdk.incubator.vector