RFR: 8304846: Provide a shared utility to dump generated classes defined via Lookup API [v5]

Jorn Vernee jvernee at openjdk.org
Mon Apr 3 19:36:00 UTC 2023


On Mon, 3 Apr 2023 19:21:00 GMT, Mandy Chung <mchung at openjdk.org> wrote:

>> src/java.base/share/classes/jdk/internal/util/ClassFileDumper.java line 115:
>> 
>>> 113:         if (dumper.isEnabled() && !path.equals(dumper.dumpPath())) {
>>> 114:             throw new IllegalArgumentException("mismatched dump path for " + key);
>>> 115:         }
>> 
>> I don't see how this exception case could ever occur, given that `dumper.dumpPath` is directly coming from `dir`, and `validateDumpDir` doesn't return a modified path either.
>> 
>> Can this check be removed?
>
> This is to check if two callers get the `ClassFileDumper` of the same key but different path.
> 
> 
>   ClassFileDumper.getInstance("jdk.foo.dump", "DUMP_DIR");
>   ClassFileDumper.getInstance("jdk.foo.dump", "DUMP_NEW_DIR");  <--- IAE

Ok, I see.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/13182#discussion_r1156378106


More information about the core-libs-dev mailing list