On Mon, 3 Apr 2023 19:21:00 GMT, Mandy Chung <mch...@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