RFR: 8361325: Refactor ClassLoaderExt [v2]

Calvin Cheung ccheung at openjdk.org
Thu Jul 3 17:12:55 UTC 2025


On Thu, 3 Jul 2025 15:10:12 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:

> It looks good to me. I like this simplification. But I'm curious what was the original reason to have the `classLoaderExt`?

I think it was created during the first revision of AppCDS back in JDK 8u.

> src/hotspot/share/cds/classListParser.cpp line 33:
> 
>> 31: #include "cds/metaspaceShared.hpp"
>> 32: #include "cds/unregisteredClasses.hpp"
>> 33: #include "classfile/classLoader.hpp"
> 
> Nit: I wonder if the line #33 is really needed and can be removed.

It is needed or else I got compilation error:

open/src/hotspot/share/cds/classListParser.cpp:561:29: error: 'ClassLoader' has not been declared
  561 |   const char* source_path = ClassLoader::uri_to_path(_source);
      |                             ^~~~~~~~~~~

It worked before because classLoaderExt.hpp includes classLoader.hpp.

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

PR Comment: https://git.openjdk.org/jdk/pull/26110#issuecomment-3032983136
PR Review Comment: https://git.openjdk.org/jdk/pull/26110#discussion_r2183292645


More information about the serviceability-dev mailing list