Skip to content

Commit 43a4ae0

Browse files
committed
Revert unnecessary changes to AgentClassLoader
1 parent 1173824 commit 43a4ae0

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/AgentClassLoader.java

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,6 @@ private static int getJavaVersion() {
142142
return Integer.parseInt(javaSpecVersion);
143143
}
144144

145-
@Override
146-
public Class<?> loadClass(String name) throws ClassNotFoundException {
147-
// We explicitly override loadClass from ClassLoader to ensure
148-
// that loadClass is properly excluded from our internal ClassLoader Instrumentations
149-
// (e.g. LoadInjectedClassInstrumentation, BooDelegationInstrumentation)
150-
// Otherwise this will cause recursion in invokedynamic linkage
151-
return loadClass(name, false);
152-
}
153-
154145
@Override
155146
public Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
156147
// ContextStorageOverride is meant for library instrumentation we don't want it to apply to our
@@ -167,14 +158,7 @@ public Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundExce
167158
}
168159
// search from parent and urls added to this loader
169160
if (clazz == null) {
170-
try {
171-
clazz = Class.forName(name, false, this.getParent());
172-
} catch (ClassNotFoundException e) {
173-
// ignore
174-
}
175-
}
176-
if (clazz == null) {
177-
clazz = super.findClass(name);
161+
clazz = super.loadClass(name, false);
178162
}
179163
if (resolve) {
180164
resolveClass(clazz);

0 commit comments

Comments
 (0)