Skip to content

Commit 1550dfc

Browse files
committed
Review fixes for pekko-actor-1.0:javaagent
Automated code review of instrumentation/pekko/pekko-actor-1.0/javaagent.
1 parent 7becc07 commit 1550dfc

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

instrumentation/pekko/pekko-actor-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/pekkoactor/v1_0/PekkoDefaultSystemMessageQueueInstrumentation.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import io.opentelemetry.javaagent.bootstrap.executors.PropagatedContext;
1818
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
1919
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
20+
import javax.annotation.Nullable;
2021
import net.bytebuddy.asm.Advice;
2122
import net.bytebuddy.description.type.TypeDescription;
2223
import net.bytebuddy.matcher.ElementMatcher;
@@ -45,6 +46,7 @@ public void transform(TypeTransformer transformer) {
4546
@SuppressWarnings("unused")
4647
public static class DispatchSystemAdvice {
4748

49+
@Nullable
4850
@Advice.OnMethodEnter(suppress = Throwable.class, inline = false)
4951
public static PropagatedContext enter(@Advice.Argument(1) SystemMessage systemMessage) {
5052
Context context = Java8BytecodeBridge.currentContext();
@@ -58,8 +60,8 @@ public static PropagatedContext enter(@Advice.Argument(1) SystemMessage systemMe
5860
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class, inline = false)
5961
public static void exit(
6062
@Advice.Argument(1) SystemMessage systemMessage,
61-
@Advice.Enter PropagatedContext propagatedContext,
62-
@Advice.Thrown Throwable throwable) {
63+
@Advice.Enter @Nullable PropagatedContext propagatedContext,
64+
@Advice.Thrown @Nullable Throwable throwable) {
6365
ExecutorAdviceHelper.cleanUpAfterSubmit(
6466
propagatedContext, throwable, SYSTEM_MESSAGE_PROPAGATED_CONTEXT, systemMessage);
6567
}

instrumentation/pekko/pekko-actor-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/pekkoactor/v1_0/PekkoDispatcherInstrumentation.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import io.opentelemetry.javaagent.bootstrap.executors.PropagatedContext;
1616
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
1717
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
18+
import javax.annotation.Nullable;
1819
import net.bytebuddy.asm.Advice;
1920
import net.bytebuddy.description.type.TypeDescription;
2021
import net.bytebuddy.matcher.ElementMatcher;
@@ -39,6 +40,7 @@ public void transform(TypeTransformer transformer) {
3940
@SuppressWarnings("unused")
4041
public static class DispatchEnvelopeAdvice {
4142

43+
@Nullable
4244
@Advice.OnMethodEnter(suppress = Throwable.class, inline = false)
4345
public static PropagatedContext enterDispatch(@Advice.Argument(1) Envelope envelope) {
4446
Context context = Java8BytecodeBridge.currentContext();
@@ -52,8 +54,8 @@ public static PropagatedContext enterDispatch(@Advice.Argument(1) Envelope envel
5254
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class, inline = false)
5355
public static void exitDispatch(
5456
@Advice.Argument(1) Envelope envelope,
55-
@Advice.Enter PropagatedContext propagatedContext,
56-
@Advice.Thrown Throwable throwable) {
57+
@Advice.Enter @Nullable PropagatedContext propagatedContext,
58+
@Advice.Thrown @Nullable Throwable throwable) {
5759
ExecutorAdviceHelper.cleanUpAfterSubmit(
5860
propagatedContext, throwable, ENVELOPE_PROPAGATED_CONTEXT, envelope);
5961
}

0 commit comments

Comments
 (0)