RFR: 8365878: jshell TOOLING's javap should use binary names
Chen Liang
liach at openjdk.org
Thu Aug 21 17:20:52 UTC 2025
On Wed, 20 Aug 2025 15:37:09 GMT, altrisi <duke at openjdk.org> wrote:
> This PR makes TOOLING.jsh's `javap` function support anonymous, local and built-in nested classes.
>
> Note that nested classes created in jshell would previously work, but not JDK ones as they'd miss the is built-in check (wrong name for `Class.forName`) and later throw an exception because of a null classloader.
>
> The rest of classes would fail the canonical name check, which wouldn't allow them to be disassembled.
>
> This change makes them work by changing the check from canonicalName != null to specific checks for unsupported types of classes, and doing Class.forName using the result of getName(), not the canonical name, for the built-in check.
Looks good to me, thanks! @sormuras may be interested in this too since he initially added this script.
test/langtools/jdk/jshell/ToolingTest.java line 1:
> 1: /*
Can you update:
On line 2, `(c) 2023, Oracle` to `(c) 2023, 2025, Oracle`
On line 26 `@bug 8306560` to `@bug 8306560 8365878`
-------------
PR Review: https://git.openjdk.org/jdk/pull/26864#pullrequestreview-3141643171
PR Review Comment: https://git.openjdk.org/jdk/pull/26864#discussion_r2291696567
More information about the compiler-dev
mailing list