Spymemcached: remove unnecessary unboxing and minor cleanup
MODIFY
dd-java-agent/instrumentation/spymemcached-2.12/src/main/java/datadog/trace/instrumentation/spymemcached/MemcachedClientInstrumentation.java
dd-java-agent/instrumentation/spymemcached-2.12/src/main/java/datadog/trace/instrumentation/spymemcached/MemcachedClientInstrumentation.java
@@ -85,13 +85,13 @@ public final class MemcachedClientInstrumentation extends Instrumenter.Configura
public static class AsyncOperationAdvice {
@Advice.OnMethodEnter(suppress = Throwable.class)
- public static Boolean methodEnter() {
+ public static boolean methodEnter() {
return CallDepthThreadLocalMap.incrementCallDepth(MemcachedClient.class) <= 0;
}
@Advice.OnMethodExit(suppress = Throwable.class)
public static void methodExit(
- @Advice.Enter final Boolean shouldInjectListener,
+ @Advice.Enter final boolean shouldInjectListener,
@Advice.Origin final Method method,
@Advice.Return final OperationFuture future) {
if (shouldInjectListener) {
@@ -106,13 +106,13 @@ public final class MemcachedClientInstrumentation extends Instrumenter.Configura
public static class AsyncGetAdvice {
@Advice.OnMethodEnter(suppress = Throwable.class)
- public static Boolean methodEnter() {
+ public static boolean methodEnter() {
return CallDepthThreadLocalMap.incrementCallDepth(MemcachedClient.class) <= 0;
}
@Advice.OnMethodExit(suppress = Throwable.class)
public static void methodExit(
- @Advice.Enter final Boolean shouldInjectListener,
+ @Advice.Enter final boolean shouldInjectListener,
@Advice.Origin final Method method,
@Advice.Return final GetFuture future) {
if (shouldInjectListener) {
@@ -127,13 +127,13 @@ public final class MemcachedClientInstrumentation extends Instrumenter.Configura
public static class AsyncBulkAdvice {
@Advice.OnMethodEnter(suppress = Throwable.class)
- public static Boolean methodEnter() {
+ public static boolean methodEnter() {
return CallDepthThreadLocalMap.incrementCallDepth(MemcachedClient.class) <= 0;
}
@Advice.OnMethodExit(suppress = Throwable.class)
public static void methodExit(
- @Advice.Enter final Boolean shouldInjectListener,
+ @Advice.Enter final boolean shouldInjectListener,
@Advice.Origin final Method method,
@Advice.Return final BulkFuture future) {
if (shouldInjectListener) {

MODIFY
dd-java-agent/instrumentation/spymemcached-2.12/src/test/groovy/datadog/trace/instrumentation/spymemcached/SpymemcachedTest.groovy
dd-java-agent/instrumentation/spymemcached-2.12/src/test/groovy/datadog/trace/instrumentation/spymemcached/SpymemcachedTest.groovy
@@ -630,9 +630,9 @@ class SpymemcachedTest extends AgentTestRunner {
tags {
defaultTags()
"${DDTags.SPAN_TYPE}" SPAN_TYPE
- "${Tags.COMPONENT.getKey()}" COMPONENT_NAME
- "${Tags.SPAN_KIND.getKey()}" Tags.SPAN_KIND_CLIENT
- "${Tags.DB_TYPE.getKey()}" CompletionListener.DB_TYPE
+ "${Tags.COMPONENT.key}" COMPONENT_NAME
+ "${Tags.SPAN_KIND.key}" Tags.SPAN_KIND_CLIENT
+ "${Tags.DB_TYPE.key}" CompletionListener.DB_TYPE
if (error == "canceled") {
"${CompletionListener.DB_COMMAND_CANCELLED}" true

Spymemcached: remove unnecessary unboxing and minor cleanup