Skip to content

Commit 62df5cc

Browse files
committed
cleanup
1 parent 9d9f3ff commit 62df5cc

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

instrumentation/methods/javaagent/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ muzzle {
1111
dependencies {
1212
compileOnly(project(":javaagent-tooling"))
1313
compileOnly(project(":instrumentation-annotations-support"))
14-
implementation("net.bytebuddy:byte-buddy-dep")
14+
compileOnly("net.bytebuddy:byte-buddy-dep")
1515
}
1616

1717
tasks.withType<Test>().configureEach {

instrumentation/methods/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/methods/MethodInstrumentation.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
2424
import java.util.Map;
2525
import net.bytebuddy.asm.Advice;
26+
import net.bytebuddy.description.enumeration.EnumerationDescription;
2627
import net.bytebuddy.description.type.TypeDescription;
2728
import net.bytebuddy.implementation.bytecode.assign.Assigner;
2829
import net.bytebuddy.matcher.ElementMatcher;
29-
import net.bytebuddy.utility.JavaConstant;
3030

3131
@SuppressWarnings("EnumOrdinal")
3232
public class MethodInstrumentation implements TypeInstrumentation {
@@ -71,8 +71,8 @@ public void transform(TypeTransformer transformer) {
7171
SpanKindOrdinal.class,
7272
(instrumentedType, instrumentedMethod, assigner, argumentHandler, sort) ->
7373
Advice.OffsetMapping.Target.ForStackManipulation.of(
74-
JavaConstant.Simple.ofLoaded(
75-
methodNames.get(instrumentedMethod.getName()).ordinal()))),
74+
new EnumerationDescription.ForLoadedEnumeration(
75+
methodNames.get(instrumentedMethod.getName())))),
7676
MethodInstrumentation.class.getName() + "$MethodAdvice");
7777
}
7878

@@ -87,7 +87,7 @@ public static class MethodAdvice {
8787

8888
@Advice.OnMethodEnter(suppress = Throwable.class)
8989
public static void onEnter(
90-
@SpanKindOrdinal int spanKindOrdinal,
90+
@SpanKindOrdinal SpanKind spanKind,
9191
@Advice.Origin("#t") Class<?> declaringClass,
9292
@Advice.Origin("#m") String methodName,
9393
@Advice.Local("otelMethod") MethodAndType classAndMethod,
@@ -97,7 +97,7 @@ public static void onEnter(
9797
classAndMethod =
9898
MethodAndType.create(
9999
ClassAndMethod.create(declaringClass, methodName),
100-
SpanKind.values()[spanKindOrdinal]);
100+
spanKind);
101101

102102
if (!instrumenter().shouldStart(parentContext, classAndMethod)) {
103103
return;

0 commit comments

Comments
 (0)