Remove last muzzleCheck methods
MODIFY
instrumentation/guava-10.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/guava/GuavaListenableFutureInstrumentation.java
instrumentation/guava-10.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/guava/GuavaListenableFutureInstrumentation.java
@@ -8,7 +8,6 @@ package io.opentelemetry.javaagent.instrumentation.guava;
import static net.bytebuddy.matcher.ElementMatchers.isConstructor;
import static net.bytebuddy.matcher.ElementMatchers.named;
-import com.google.common.util.concurrent.AbstractFuture;
import io.opentelemetry.context.Context;
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
@@ -66,11 +65,5 @@ public class GuavaListenableFutureInstrumentation implements TypeInstrumentation
@Advice.Enter final State state, @Advice.Thrown final Throwable throwable) {
ExecutorInstrumentationUtils.cleanUpOnMethodExit(state, throwable);
}
-
- // Used by muzzle
- @SuppressWarnings("UnusedMethod")
- private static void muzzleCheck(final AbstractFuture<?> future) {
- future.addListener(null, null);
- }
}
}

MODIFY
instrumentation/play/play-2.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/play/v2_4/ActionInstrumentation.java
instrumentation/play/play-2.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/play/v2_4/ActionInstrumentation.java
@@ -23,10 +23,8 @@ import net.bytebuddy.asm.Advice;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.matcher.ElementMatcher;
import play.api.mvc.Action;
-import play.api.mvc.Headers;
import play.api.mvc.Request;
import play.api.mvc.Result;
-import play.libs.Akka;
import scala.concurrent.Future;
public class ActionInstrumentation implements TypeInstrumentation {
@@ -81,13 +79,5 @@ public class ActionInstrumentation implements TypeInstrumentation {
tracer().endExceptionally(context, throwable);
}
}
-
- // Unused method for muzzle
- public static void muzzleCheck(Headers headers) {
- // This distinguishes between 2.3 and 2.4, excluding the former
- headers.get("aKey");
- // system() method was removed in 2.6, so this line prevents from applying in play 2.6
- Akka.system();
- }
}
}

MODIFY
instrumentation/play/play-2.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/play/v2_4/PlayInstrumentationModule.java
instrumentation/play/play-2.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/play/v2_4/PlayInstrumentationModule.java
package io.opentelemetry.javaagent.instrumentation.play.v2_4;
+import static io.opentelemetry.javaagent.extension.matcher.ClassLoaderMatcher.hasClassesNamed;
import static java.util.Collections.singletonList;
import com.google.auto.service.AutoService;
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
import java.util.List;
+import net.bytebuddy.matcher.ElementMatcher;
@AutoService(InstrumentationModule.class)
public class PlayInstrumentationModule extends InstrumentationModule {
@@ -19,6 +21,12 @@ public class PlayInstrumentationModule extends InstrumentationModule {
super("play", "play-2.4");
}
+ @Override
+ public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
+ // play.GlobalSettings was removed in 2.6
+ return hasClassesNamed("play.GlobalSettings");
+ }
+
@Override
public List<TypeInstrumentation> typeInstrumentations() {
return singletonList(new ActionInstrumentation());

Remove last muzzleCheck methods (#3208)