RFR: 8375580: Avoid using ArrayDeque in jdk.internal.loader.URLClassPath [v3]
Eirik Bjørsnøs
eirbjo at openjdk.org
Mon Jan 26 14:31:17 UTC 2026
On Mon, 26 Jan 2026 14:04:01 GMT, Eirik Bjørsnøs <eirbjo at openjdk.org> wrote:
>> test/jdk/jdk/internal/loader/URLClassPath/JarClassPathDfsOrder.java line 50:
>>
>>> 48: * @run junit JarClassPathDfsOrder
>>> 49: */
>>> 50: public class JarClassPathDfsOrder {
>>
>> The JAR specification for the `Class-Path` attribute states:
>>
>>> The resulting URLs are inserted into the class path, immediately following the URL of the context JAR. For example, given the following class path ...
>>
>> so it's good to introduce a test for this (I haven't verified we don't have any). However, I think the use of DFS in the test name and comments can be removed. I think we should name the test `JarManifestClassPathOrder`.
>
> Thanks, I have renamed the test and deemphasized the "DFS" aspect in comments.
>
> The long-standing behavior that we want to prevent regressions of is to find these files in DFS order though, so I left some minimum mentioning of it.
>
> Take a look at the updated test and let me know what you think.
> so it's good to introduce a test for this (I haven't verified we don't have any).
I removed `reversed()` in `addManifestClassPaths` and ran tests in `jdk/internal/loader` and `java/net/URLClassLoader`.
The introduced regression was caught by the new test, but not by any existing test.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29288#discussion_r2727826649
More information about the core-libs-dev
mailing list