Skip to content

Commit cadca12

Browse files
committed
fix a few things
1 parent 31f606d commit cadca12

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

instrumentation/jaxrs/jaxrs-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v1_0/JaxrsAnnotationsInstrumentation.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import static net.bytebuddy.matcher.ElementMatchers.namedOneOf;
1818
import static net.bytebuddy.matcher.ElementMatchers.not;
1919

20+
import com.google.errorprone.annotations.CanIgnoreReturnValue;
2021
import io.opentelemetry.context.Context;
2122
import io.opentelemetry.context.Scope;
2223
import io.opentelemetry.instrumentation.api.semconv.http.HttpServerRoute;
@@ -78,6 +79,7 @@ public AdviceScope(CallDepth callDepth) {
7879
this.callDepth = callDepth;
7980
}
8081

82+
@CanIgnoreReturnValue
8183
public AdviceScope enter(Class<?> type, Method method) {
8284
if (callDepth.getAndIncrement() > 0) {
8385
return this;

instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-annotations/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v2_0/JaxrsAnnotationsInstrumentation.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import static net.bytebuddy.matcher.ElementMatchers.namedOneOf;
1717
import static net.bytebuddy.matcher.ElementMatchers.not;
1818

19+
import com.google.errorprone.annotations.CanIgnoreReturnValue;
1920
import io.opentelemetry.context.Context;
2021
import io.opentelemetry.context.Scope;
2122
import io.opentelemetry.instrumentation.api.semconv.http.HttpServerRoute;
@@ -82,6 +83,7 @@ public AdviceScope(CallDepth callDepth) {
8283
this.callDepth = callDepth;
8384
}
8485

86+
@CanIgnoreReturnValue
8587
public AdviceScope enter(Object[] args, Object target, Method method) {
8688
if (callDepth.getAndIncrement() > 0) {
8789
return this;
@@ -128,6 +130,7 @@ public AdviceScope enter(Object[] args, Object target, Method method) {
128130
}
129131

130132
@Nullable
133+
@CanIgnoreReturnValue
131134
public Object exit(@Nullable Throwable throwable, @Nullable Object returnValue) {
132135

133136
if (callDepth.decrementAndGet() > 0) {

instrumentation/jaxrs/jaxrs-2.0/jaxrs-2.0-jersey-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v2_0/JerseyServletContainerInstrumentation.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import io.opentelemetry.javaagent.bootstrap.jaxrs.JaxrsContextPath;
1616
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
1717
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
18+
import javax.annotation.Nullable;
1819
import javax.servlet.http.HttpServletRequest;
1920
import net.bytebuddy.asm.Advice;
2021
import net.bytebuddy.description.type.TypeDescription;

instrumentation/jaxrs/jaxrs-3.0/jaxrs-3.0-annotations/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v3_0/JaxrsAnnotationsInstrumentation.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import static net.bytebuddy.matcher.ElementMatchers.namedOneOf;
1717
import static net.bytebuddy.matcher.ElementMatchers.not;
1818

19+
import com.google.errorprone.annotations.CanIgnoreReturnValue;
1920
import io.opentelemetry.context.Context;
2021
import io.opentelemetry.context.Scope;
2122
import io.opentelemetry.instrumentation.api.semconv.http.HttpServerRoute;
@@ -82,6 +83,7 @@ public AdviceScope(CallDepth callDepth) {
8283
this.callDepth = callDepth;
8384
}
8485

86+
@CanIgnoreReturnValue
8587
public AdviceScope enter(Class<?> type, Method method, Object[] args) {
8688
if (callDepth.getAndIncrement() > 0) {
8789
return this;
@@ -128,6 +130,7 @@ public AdviceScope enter(Class<?> type, Method method, Object[] args) {
128130
}
129131

130132
@Nullable
133+
@CanIgnoreReturnValue
131134
public Object exit(@Nullable Object returnValue, @Nullable Throwable throwable) {
132135
if (callDepth.decrementAndGet() > 0) {
133136
return returnValue;

0 commit comments

Comments
 (0)