Add java21-to-25 module: compile-once probes on JDK 21 and 25, removed APIs, build matrix, pinning, compact headers and containers

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b7N4ZDbUtA3ofqAqRV
This commit is contained in:
Claude
2026-12-03 09:26:21 +05:30
parent d4b8552957
commit 3502fd7804
46 changed files with 1371 additions and 0 deletions
+69
View File
@@ -0,0 +1,69 @@
#!/usr/bin/env python3
"""Public types and methods present in the older javap dump and gone from the newer one.
usage: removed_api.py <old-dump> <new-dump> (dumps made by ../../api-diff/dump_api.py)
Modifier and 'throws' changes are ignored: a method counts as removed only if no method with the same
name and parameter types is declared on the class or on any supertype in the newer dump.
com.sun.source (compiler tree API) and jdk.jfr.snippets are skipped.
"""
import re, sys
def strip_generics(s):
prev = None
while prev != s:
prev, s = s, re.sub(r"<[^<>]*>", "", s)
return s
def parse(path):
out, cur = {}, None
for line in open(path):
line = line.rstrip("\n")
if line.startswith("#####") or line.startswith("Compiled from") or not line.strip() or line.strip() == "}":
continue
if not line.startswith(" "):
bare = strip_generics(line)
m = re.search(r"(?:class|interface)\s+([\w.$]+)", bare)
if not m:
cur = None
continue
cur = m.group(1)
supers = []
for kw in ("extends", "implements"):
k = re.search(kw + r"\s+(.*?)(?:\s+implements|\s*\{|$)", bare)
if k:
supers += [x.strip() for x in k.group(1).split(",")]
out[cur] = {"public": bare.startswith(("public ", "protected ")), "supers": supers, "methods": set()}
elif cur:
sig = strip_generics(line.strip())
m = re.search(r"([\w$]+)\(([^)]*)\)", sig)
if m and sig.startswith(("public", "protected")):
out[cur]["methods"].add(f"{m.group(1)}({m.group(2).replace(' ', '')})")
return out
old, new = parse(sys.argv[1]), parse(sys.argv[2])
def inherited(cls, sig, seen=None):
seen = seen or set()
if cls in seen:
return False
seen.add(cls)
info = new.get(cls)
if info is None:
return False
if sig in info["methods"]:
return True
return any(inherited(s, sig, seen) for s in info["supers"] + ["java.lang.Object"])
skip = ("com.sun.source.", "jdk.jfr.snippets")
print("## public types removed")
for c in sorted(set(old) - set(new)):
if old[c]["public"] and not c.startswith(skip):
print(" " + c)
print("## public methods removed (not inherited from a supertype either)")
for c in sorted(set(old) & set(new)):
if not old[c]["public"] or c.startswith(skip):
continue
for sig in sorted(old[c]["methods"] - new[c]["methods"]):
if not inherited(c, sig):
print(f" {c}.{sig}")