From 17f61c1dad9bbfa221dbc654743a9e32a3b6be7d Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 27 Oct 2015 10:08:19 +0000 Subject: [PATCH] Update javadoc of LaunchedURLClassLoader to describe delegation model Closes gh-3864 --- .../boot/loader/LaunchedURLClassLoader.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 getResources(String name) throws IOException { if (this.rootClassLoader == null) {