Skip to content

Commit

Permalink
Fixed bug in the order of operations
Browse files Browse the repository at this point in the history
  • Loading branch information
Thrameos committed Nov 27, 2024
1 parent 95346dc commit 6950c29
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions native/java/org/jpype/classloader/DynamicClassLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,27 @@ public Class findClass(String name) throws ClassNotFoundException, ClassFormatEr
@Override
public URL getResource(String name)
{
// Search our parent
URL url = this.getParent().getResource(name);
if (url != null)
return url;

// Otherwise search locally
return findResource(name);
}

url = super.getResource(name);
if (url != null)
return url;

for (ClassLoader cl : this.loaders)
@Override
public URL findResource(String name)
{
// Check local first
URL url = super.findResource(name);
if (url != null)
return url;

// Use one of the subs
for (URLClassLoader cl : this.loaders)
{
url = cl.getResource(name);
url = cl.findResource(name);
if (url != null)
return url;
}
Expand Down

0 comments on commit 6950c29

Please sign in to comment.