RFR: 8336470: Source launcher should work with service loader SPI in unnamed module [v4]

Christian Stein cstein at openjdk.org
Sat Jul 20 19:26:31 UTC 2024


On Fri, 19 Jul 2024 15:31:14 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> Christian Stein has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fixup line endings
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/MemoryClassLoader.java line 277:
> 
>> 275:      * @return the URL of the resource, or null
>> 276:      */
>> 277:     private URL toResourceInRootPath(String name) {
> 
> Is this method expected to return `URL` to a `.class` file too? The reason I ask this is, I notice that for classes that belong within the source java file we use a different protocol scheme for the URIs. Is that `sourcelauncher-` protocol meant only for classes that are part of the source file that is launched?

Every file that is resolvable under the computed source root path is expected to be returned by this method. This includes `.class` files. But you maybe right that such files should be excluded; or at least be handled the application class loader. Have to write a few more tests to give a better answer.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20193#discussion_r1685522415


More information about the compiler-dev mailing list