Skip to content

Commit 84128a8

Browse files
committed
Merge branch '3.3.x' into 3.4.x
Closes gh-45100
2 parents 87cd1bb + b4c6c55 commit 84128a8

File tree

1 file changed

+14
-1
lines changed
  • spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/classpath/resources

1 file changed

+14
-1
lines changed

spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/classpath/resources/ResourcesClassLoader.java

+14-1
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,19 @@
1919
import java.io.IOException;
2020
import java.io.UncheckedIOException;
2121
import java.net.URL;
22+
import java.security.ProtectionDomain;
2223
import java.util.ArrayList;
2324
import java.util.Collections;
2425
import java.util.Enumeration;
2526

27+
import org.springframework.core.SmartClassLoader;
28+
2629
/**
2730
* A {@link ClassLoader} that provides access to {@link Resources resources}.
2831
*
2932
* @author Andy Wilkinson
3033
*/
31-
class ResourcesClassLoader extends ClassLoader {
34+
class ResourcesClassLoader extends ClassLoader implements SmartClassLoader {
3235

3336
private final Resources resources;
3437

@@ -66,4 +69,14 @@ public Enumeration<URL> getResources(String name) throws IOException {
6669
return Collections.enumeration(urls);
6770
}
6871

72+
@Override
73+
public ClassLoader getOriginalClassLoader() {
74+
return getParent();
75+
}
76+
77+
@Override
78+
public Class<?> publicDefineClass(String name, byte[] b, ProtectionDomain protectionDomain) {
79+
return defineClass(name, b, 0, b.length, protectionDomain);
80+
}
81+
6982
}

0 commit comments

Comments
 (0)