|
1 | 1 | This tool scans the JDK on which it is running to extract its public accessible API.
|
2 | 2 | That is:
|
3 |
| -- public methods (including constructors) of public, exported classes as well as protected methods of these if not final. |
4 |
| -- internal implementations (overwrites) of above. |
| 3 | +- public methods (including constructors) of public, exported classes as well as protected methods of non-final classes. |
| 4 | +- any overwrites of public methods of public, exported super classes and interfaces. |
5 | 5 |
|
6 | 6 | The output of this tool is meant to be diffed against the output for another JDK
|
7 | 7 | version to identify changes that need to be reviewed for entitlements.
|
| 8 | +The output is compatible with the `public-callers-finder` tool to calculate the |
| 9 | +public transitive surface of new additions. See the example below. |
8 | 10 |
|
9 | 11 | The following `TAB`-separated columns are written:
|
10 | 12 | 1. module name
|
11 |
| -2. fully qualified class name (ASM style, with `/` separators) |
12 |
| -3. method name |
13 |
| -4. method descriptor (ASM signature) |
14 |
| -5. visibility (`PUBLIC` / `PROTECTED`) |
15 |
| -6. `STATIC` modifier or empty |
16 |
| -7. `FINAL` modifier or empty |
| 13 | +2. unused / empty (for compatibility with `public-callers-finder`) |
| 14 | +3. unused / empty (for compatibility with `public-callers-finder`) |
| 15 | +4. fully qualified class name (ASM style, with `/` separators) |
| 16 | +5. method name |
| 17 | +6. method descriptor (ASM signature) |
| 18 | +7. visibility (`PUBLIC` / `PROTECTED`) |
| 19 | +8. `STATIC` modifier or empty |
| 20 | +9. `FINAL` modifier or empty |
17 | 21 |
|
18 | 22 | Usage example:
|
19 | 23 | ```bash
|
20 | 24 | ./gradlew :libs:entitlement:tools:jdk-api-extractor:run -Druntime.java=24 --args="api-jdk24.tsv"
|
21 | 25 | ./gradlew :libs:entitlement:tools:jdk-api-extractor:run -Druntime.java=25 --args="api-jdk25.tsv"
|
| 26 | + |
22 | 27 | # diff the public apis
|
23 | 28 | 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
|
| 29 | + |
24 | 30 | # extract additions in the new JDK, these require the most careful review
|
25 | 31 | cat libs/entitlement/tools/jdk-api-extractor/api.diff | grep '^+[^+]' | sed 's/^+//' > api-jdk25-additions.tsv
|
| 32 | + |
| 33 | +# review new additions next for critical ones that should require entitlements |
| 34 | +# once done, remove all lines that are not considered critical and run the public-callers-finder to report |
| 35 | +# the transitive public surface for these additions |
| 36 | +./gradlew :libs:entitlement:tools:public-callers-finder:run -Druntime.java=25 --args="api-jdk25-additions.tsv true" |
26 | 37 | ```
|
27 | 38 |
|
28 | 39 | ### Optional arguments:
|
|
0 commit comments