Skip to content

Commit 67b1d40

Browse files
committed
Remove redundant excludes
1 parent e8a5ef2 commit 67b1d40

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

instrumentation/internal/internal-class-loader/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/internal/classloader/BootDelegationInstrumentation.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,7 @@ public class BootDelegationInstrumentation implements TypeInstrumentation {
4747
public ElementMatcher<TypeDescription> typeMatcher() {
4848
// just an optimization to exclude common class loaders that are known to delegate to the
4949
// bootstrap loader (or happen to _be_ the bootstrap loader)
50-
// The AgentClassLoader and InstrumentationModuleClassloaders are required to be excluded
51-
// for the instrumentation to work properly. loadClass on those is invoked during Advice
52-
// bootstrapping which therefore would cause an infinite recursion
53-
return not(namedOneOf(
54-
"java.lang.ClassLoader",
55-
"com.ibm.oti.vm.BootstrapClassLoader",
56-
"io.opentelemetry.javaagent.bootstrap.AgentClassLoader",
57-
"io.opentelemetry.javaagent.tooling.instrumentation.indy.InstrumentationModuleClassLoader"))
50+
return not(namedOneOf("java.lang.ClassLoader", "com.ibm.oti.vm.BootstrapClassLoader"))
5851
.and(extendsClass(named("java.lang.ClassLoader")));
5952
}
6053

instrumentation/internal/internal-class-loader/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/internal/classloader/LoadInjectedClassInstrumentation.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
1212
import static net.bytebuddy.matcher.ElementMatchers.isStatic;
1313
import static net.bytebuddy.matcher.ElementMatchers.named;
14-
import static net.bytebuddy.matcher.ElementMatchers.namedOneOf;
1514
import static net.bytebuddy.matcher.ElementMatchers.not;
1615
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
1716
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
@@ -31,15 +30,7 @@ public class LoadInjectedClassInstrumentation implements TypeInstrumentation {
3130

3231
@Override
3332
public ElementMatcher<TypeDescription> typeMatcher() {
34-
// We explicitly exclude our own classloaders:
35-
// The invokedynamic bootstrapping involves calling loadClass on those, which would cause
36-
// an infinite recursion
37-
return extendsClass(named("java.lang.ClassLoader"))
38-
.and(
39-
not(
40-
namedOneOf(
41-
"io.opentelemetry.javaagent.bootstrap.AgentClassLoader",
42-
"io.opentelemetry.javaagent.tooling.instrumentation.indy.InstrumentationModuleClassLoader")));
33+
return extendsClass(named("java.lang.ClassLoader"));
4334
}
4435

4536
@Override

0 commit comments

Comments
 (0)