diff --git a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/LaunchedURLClassLoader.java b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/LaunchedURLClassLoader.java index e8d2b8b8a8..a837ff4880 100644 --- a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/LaunchedURLClassLoader.java +++ b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/LaunchedURLClassLoader.java @@ -62,6 +62,13 @@ public class LaunchedURLClassLoader extends URLClassLoader { return null; } + /** + * Gets the resource with the given {@code name}. + *
+ * Unlike a standard {@link ClassLoader}, this method will first search the root class + * loader. If the resource is not found, this method will call + * {@link #findResource(String)}. + */ @Override public URL getResource(String name) { URL url = null; @@ -96,6 +103,13 @@ public class LaunchedURLClassLoader extends URLClassLoader { return getURLs().length > 0; } + /** + * Gets the resources with the given {@code name}. + *
+ * Returns a combination of the resources found by {@link #findResources(String)} and
+ * from {@link ClassLoader#getResources(String) getResources(String)} on the root
+ * class loader, if any.
+ */
@Override
public Enumeration