Simplify a couple of type matchers
MODIFY
instrumentation/finatra-2.9/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/finatra/FinatraRouteInstrumentation.java
instrumentation/finatra-2.9/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/finatra/FinatraRouteInstrumentation.java
package io.opentelemetry.javaagent.instrumentation.finatra;
-import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.extendsClass;
-import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.hasClassesNamed;
import static io.opentelemetry.javaagent.instrumentation.finatra.FinatraSingletons.instrumenter;
import static io.opentelemetry.javaagent.instrumentation.finatra.FinatraSingletons.updateServerSpanName;
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
-import static net.bytebuddy.matcher.ElementMatchers.nameStartsWith;
import static net.bytebuddy.matcher.ElementMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
@@ -29,15 +26,10 @@ import net.bytebuddy.matcher.ElementMatcher;
import scala.Some;
public class FinatraRouteInstrumentation implements TypeInstrumentation {
- @Override
- public ElementMatcher<ClassLoader> classLoaderOptimization() {
- return hasClassesNamed("com.twitter.finatra.http.internal.routing.Route");
- }
@Override
public ElementMatcher<TypeDescription> typeMatcher() {
- return nameStartsWith("com.twitter.finatra.")
- .and(extendsClass(named("com.twitter.finatra.http.internal.routing.Route")));
+ return named("com.twitter.finatra.http.internal.routing.Route");
}
@Override

MODIFY
instrumentation/spring/spring-rmi-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/springrmi/client/ClientInstrumentation.java
instrumentation/spring/spring-rmi-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/springrmi/client/ClientInstrumentation.java
package io.opentelemetry.javaagent.instrumentation.springrmi.client;
-import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.extendsClass;
-import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.hasClassesNamed;
import static io.opentelemetry.javaagent.instrumentation.springrmi.SpringRmiSingletons.clientInstrumenter;
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
import static net.bytebuddy.matcher.ElementMatchers.named;
@@ -24,14 +22,10 @@ import net.bytebuddy.matcher.ElementMatcher;
import org.aopalliance.intercept.MethodInvocation;
public class ClientInstrumentation implements TypeInstrumentation {
- @Override
- public ElementMatcher<ClassLoader> classLoaderOptimization() {
- return hasClassesNamed("org.springframework.remoting.rmi.RmiClientInterceptor");
- }
@Override
public ElementMatcher<TypeDescription> typeMatcher() {
- return extendsClass(named("org.springframework.remoting.rmi.RmiClientInterceptor"));
+ return named("org.springframework.remoting.rmi.RmiClientInterceptor");
}
@Override

Simplify a couple of type matchers (#6438)