Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B38FGKKam5SCGgwgduVAh3
42 lines
2.6 KiB
Bash
Executable File
42 lines
2.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# The JDK 27 changes that are not JEPs but will still break somebody's Monday: JVM options that no
|
|
# longer exist, a launch mechanism that is gone, a locale property that is ignored, new public APIs.
|
|
# ./scripts/other-changes.sh -> docs/output/60-removed-options.txt, 61-behaviour-changes.txt, 62-new-api.txt
|
|
set -uo pipefail
|
|
source "$(dirname "$0")/env.sh"
|
|
B="$ROOT/build/other"; rm -rf "$B"; mkdir -p "$B"
|
|
SRC="$ROOT/other-changes/src"
|
|
"$JDK27/bin/javac" --release 26 -d "$B" "$SRC/Compat.java" "$SRC/SpawnProbe.java"
|
|
"$JDK27/bin/javac" --enable-preview --release 27 -d "$B" "$SRC/Check.java" "$SRC/Api27.java" 2>&1 | grep -v '^Note' || true
|
|
|
|
# first two lines of the JVM's response to a launch option, and the exit code
|
|
try() { local jdk="$1"; shift; local out rc; out="$("$jdk/bin/java" "$@" -version 2>&1 | grep -v -E '^(openjdk version|OpenJDK Runtime|OpenJDK 64-Bit Server VM \()' | head -2)"; rc=${PIPESTATUS[0]}
|
|
[ -z "$out" ] && out="(accepted silently)"; printf '%s\n' "$out" | sed 's/^/ /'; }
|
|
|
|
{
|
|
echo "# JVM options that JDK 27 removed or renamed. Each runs 'java <option> -version' on 26 and on 27."
|
|
for opt in "-noverify" "-Xverify:none" "-noclassgc" "-XX:+UseCompressedClassPointers" \
|
|
"-XX:InitiatingHeapOccupancyPercent=40" "-XX:G1IHOP=40"; do
|
|
echo; echo "=== $opt"
|
|
for v in 26 27; do jdk="JDK$v"; echo " JDK $v:"; try "${!jdk}" $opt; done
|
|
done
|
|
echo; echo "=== -XX:+UnlockExperimentalVMOptions -XX:+UseGraalJIT (JVMCI and the Graal JIT hook were removed in 27)"
|
|
for v in 26 27; do jdk="JDK$v"; echo " JDK $v:"; try "${!jdk}" -XX:+UnlockExperimentalVMOptions -XX:+UseGraalJIT; done
|
|
} > "$OUT/60-removed-options.txt" 2>&1
|
|
|
|
{
|
|
echo "# Behaviour changes that need no new API to observe"
|
|
echo; echo "=== a script that pins the VFORK process launch mechanism"
|
|
for v in 26 27; do jdk="JDK$v"; echo " JDK $v: java -Djdk.lang.Process.launchMechanism=VFORK SpawnProbe"
|
|
"${!jdk}/bin/java" -Djdk.lang.Process.launchMechanism=VFORK -cp "$B" SpawnProbe 2>&1 | head -3 | sed 's/^/ /'; done
|
|
echo; echo "=== the legacy ISO 639 language codes property (iw, ji, in)"
|
|
for v in 26 27; do jdk="JDK$v"; echo " JDK $v: java -Djava.locale.useOldISOCodes=true Compat"
|
|
"${!jdk}/bin/java" -Djava.locale.useOldISOCodes=true -cp "$B" Compat 2>&1 | sed 's/^/ /'; done
|
|
} > "$OUT/61-behaviour-changes.txt" 2>&1
|
|
|
|
{
|
|
echo "# New public API in 27, each exercised once (found by diffing javap dumps, see 51-api-diff-26-to-27.txt)"
|
|
"$JDK27/bin/java" --enable-preview -Dstdout.encoding=UTF-8 -cp "$B" Api27 2>&1
|
|
} > "$OUT/62-new-api.txt" 2>&1
|
|
cat "$OUT"/60-removed-options.txt "$OUT"/61-behaviour-changes.txt "$OUT"/62-new-api.txt
|