libs/entitlement/tools/jdk-api-extractor/README.md
This tool scans the JDK on which it is running to extract its public accessible API. That is:
The output of this tool is meant to be diffed against the output for another JDK
version to identify changes that need to be reviewed for entitlements.
The output is compatible with the public-callers-finder tool to calculate the
public transitive surface of new additions. See the example below.
The following TAB-separated columns are written:
public-callers-finder)public-callers-finder)/ separators)PUBLIC / PROTECTED)STATIC modifier or emptyFINAL modifier or emptyUsage example:
./gradlew :libs:entitlement:tools:jdk-api-extractor:run -Druntime.java=24 --args="api-jdk24.tsv"
./gradlew :libs:entitlement:tools:jdk-api-extractor:run -Druntime.java=25 --args="api-jdk25.tsv"
# diff the public apis
diff -u libs/entitlement/tools/jdk-api-extractor/api-jdk24.tsv libs/entitlement/tools/jdk-api-extractor/api-jdk25.tsv > libs/entitlement/tools/jdk-api-extractor/api.diff
# extract additions in the new JDK, these require the most careful review
cat libs/entitlement/tools/jdk-api-extractor/api.diff | grep '^+[^+]' | sed 's/^+//' > api-jdk25-additions.tsv
# review new additions next for critical ones that should require entitlements
# once done, remove all lines that are not considered critical and run the public-callers-finder to report
# the transitive public surface for these additions to identify methods that are node already covered by entitlements
./gradlew :libs:entitlement:tools:public-callers-finder:run -Druntime.java=25 --args="api-jdk25-additions.tsv --transitive --check-instrumentation"
--deprecations-only: reports public deprecations (by means of @Deprecated)--include-incubator: include incubator modules (e.g. jdk.incubator.vector)If -Druntime.java is not provided, the bundled JDK is used.
./gradlew :libs:entitlement:tools:jdk-api-extractor:run -Druntime.java=24 --args="deprecations-jdk24.tsv --deprecations-only"