Skip to content

Commit c5bf4e6

Browse files
committed
add context
1 parent 59f1c4d commit c5bf4e6

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

testing-common/integration-tests/src/test/java/instrumentation/AgentInstrumentationTest.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,14 @@ void classPathSetUp() throws ClassNotFoundException {
5050
for (ClassPath.ClassInfo info : getTestClasspath().getAllClasses()) {
5151
for (String bootstrapPrefix : BOOTSTRAP_PACKAGE_PREFIXES) {
5252
if (info.getName().startsWith(bootstrapPrefix)) {
53-
Class<?> bootstrapClass = Class.forName(info.getName());
54-
ClassLoader loader = bootstrapClass.getClassLoader();
55-
if (loader != BOOTSTRAP_CLASSLOADER) {
56-
bootstrapClassesIncorrectlyLoaded.add(bootstrapClass);
53+
try {
54+
Class<?> bootstrapClass = Class.forName(info.getName());
55+
ClassLoader loader = bootstrapClass.getClassLoader();
56+
if (loader != BOOTSTRAP_CLASSLOADER) {
57+
bootstrapClassesIncorrectlyLoaded.add(bootstrapClass);
58+
}
59+
} catch (ClassNotFoundException e) {
60+
throw new RuntimeException("Failed to load bootstrap class: " + info.getName() + " in " + bootstrapPrefix, e);
5761
}
5862
}
5963
}

0 commit comments

Comments
 (0)