RFR: 8304846: Provide a shared utility to dump generated classes defined via Lookup API [v3]
Mandy Chung
mchung at openjdk.org
Tue Mar 28 22:14:32 UTC 2023
On Tue, 28 Mar 2023 21:51:21 GMT, Roger Riggs <rriggs at openjdk.org> wrote:
>> Mandy Chung has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - move ClassFileDumper to jdk.internal.util
>> - rename the system property for dumping class files
>
> src/java.base/share/classes/jdk/internal/util/ClassFileDumper.java line 209:
>
>> 207: final int len = className.length();
>> 208: StringBuilder sb = new StringBuilder(len);
>> 209:
>
> This could be fewer lines of adhoc conversions, the replacements are hex encoding of the characters, so the replacement array is not needed.
> java.util.HexFormat should be used for the hex encoding. The `formatHex` methods append to a StringBuilder.
This old code was from ProxyClassesDumper. Yes it can be converted to use HexFormat.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13182#discussion_r1151200144
More information about the core-libs-dev
mailing list