Fix muzzle

This commit is contained in:
Will Gittoes 2019-03-06 10:39:46 +11:00
parent 01f4666ac4
commit 7ed7ce7518
No known key found for this signature in database
GPG Key ID: 521026A02DB0BB42
2 changed files with 7 additions and 6 deletions

View File

@ -2,6 +2,7 @@ package datadog.trace.instrumentation.hibernate5;
import static datadog.trace.agent.tooling.ByteBuddyElementMatchers.safeHasSuperType;
import static datadog.trace.instrumentation.hibernate5.HibernateDecorator.DECORATOR;
import static datadog.trace.instrumentation.hibernate5.SessionMethodUtils.SCOPE_ONLY_METHODS;
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
import static net.bytebuddy.matcher.ElementMatchers.named;
@ -15,12 +16,9 @@ import datadog.trace.agent.tooling.Instrumenter;
import datadog.trace.bootstrap.ContextStore;
import datadog.trace.bootstrap.InstrumentationContext;
import io.opentracing.Span;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import net.bytebuddy.asm.Advice;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.description.type.TypeDescription;
@ -151,9 +149,6 @@ public class SessionInstrumentation extends Instrumenter.Default {
public static class SessionMethodAdvice {
public static final Set<String> SCOPE_ONLY_METHODS =
new HashSet<>(Arrays.asList("immediateLoad", "internalLoad"));
@Advice.OnMethodEnter(suppress = Throwable.class)
public static SessionState startMethod(
@Advice.This final SharedSessionContract session,

View File

@ -7,9 +7,15 @@ import datadog.trace.bootstrap.ContextStore;
import io.opentracing.Scope;
import io.opentracing.Span;
import io.opentracing.util.GlobalTracer;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
public class SessionMethodUtils {
public static final Set<String> SCOPE_ONLY_METHODS =
new HashSet<>(Arrays.asList("immediateLoad", "internalLoad"));
// Starts a scope as a child from a Span, where the Span is attached to the given spanKey using
// the given contextStore.
public static <TARGET, ENTITY> SessionState startScopeFrom(