Remove Hamcrest support from CompileWithTargetClassAccessClassLoader

CompileWithTargetClassAccessClassLoader is currently only used within the
CompileWithTargetClassAccessExtension which is dedicated to JUnit Jupiter
support which in turn should not have any direct dependencies on Hamcrest.

In other words, the JupiterTestEngine should not load any Hamcrest types
that would cause issues with the CompileWithTargetClassAccessClassLoader.
This commit is contained in:
Sam Brannen 2022-08-01 13:37:03 +03:00
parent d9bf3e54f7
commit 42ea09b08a
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ final class CompileWithTargetClassAccessClassLoader extends ClassLoader {
@Override
public Class<?> loadClass(String name) throws ClassNotFoundException {
if (name.startsWith("org.junit") || name.startsWith("org.hamcrest")) {
if (name.startsWith("org.junit")) {
return Class.forName(name, false, this.testClassLoader);
}
return super.loadClass(name);