Simplify reversed-order adding to loaderPath

This commit is contained in:
Eirik Bjorsnos 2026-01-18 12:31:45 +01:00
parent f86cd2d3a7
commit 8d0431e47f

View File

@ -487,10 +487,8 @@ public class URLClassPath {
*/
private void push(URL[] urls) {
synchronized (path) {
// URLs will be consumed tail-first
for (int i = urls.length - 1; i >= 0; --i) {
loaderPath.addLast(urls[i]);
}
// Adding in reversed order since URLs are consumed tail-first
loaderPath.addAll(Arrays.asList(urls).reversed());
}
}