Skip to content

Commit 40011e6

Browse files
fix(deps): update errorproneversion to v2.22.0 (#9535)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Lauri Tulmin <[email protected]>
1 parent 7d22597 commit 40011e6

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

custom-checks/src/main/java/io/opentelemetry/javaagent/customchecks/OtelCanIgnoreReturnValueSuggester.java

+15-1
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99

1010
import com.google.auto.service.AutoService;
1111
import com.google.errorprone.BugPattern;
12+
import com.google.errorprone.ErrorProneFlags;
1213
import com.google.errorprone.VisitorState;
1314
import com.google.errorprone.bugpatterns.BugChecker;
1415
import com.google.errorprone.bugpatterns.checkreturnvalue.CanIgnoreReturnValueSuggester;
1516
import com.google.errorprone.matchers.Description;
17+
import com.google.inject.Inject;
1618
import com.sun.source.tree.ClassTree;
1719
import com.sun.source.tree.MethodTree;
1820
import com.sun.source.util.TreePath;
@@ -27,7 +29,19 @@ public class OtelCanIgnoreReturnValueSuggester extends BugChecker
2729

2830
private static final long serialVersionUID = 1L;
2931

30-
private final CanIgnoreReturnValueSuggester delegate = new CanIgnoreReturnValueSuggester();
32+
private final CanIgnoreReturnValueSuggester delegate;
33+
34+
@Inject
35+
OtelCanIgnoreReturnValueSuggester(ErrorProneFlags errorProneFlags) {
36+
delegate = new CanIgnoreReturnValueSuggester(errorProneFlags);
37+
}
38+
39+
public OtelCanIgnoreReturnValueSuggester() {
40+
// https://errorprone.info/docs/plugins
41+
// this constructor is used by ServiceLoader, actual instance will be created with the other
42+
// constructor
43+
delegate = null;
44+
}
3145

3246
@Override
3347
public Description matchMethod(MethodTree methodTree, VisitorState visitorState) {

dependencyManagement/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ val DEPENDENCY_BOMS = listOf(
3939

4040
val autoServiceVersion = "1.1.1"
4141
val autoValueVersion = "1.10.4"
42-
val errorProneVersion = "2.21.1"
42+
val errorProneVersion = "2.22.0"
4343
val byteBuddyVersion = "1.14.8"
4444
val asmVersion = "9.5"
4545
val jmhVersion = "1.37"

instrumentation/kubernetes-client-7.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/kubernetesclient/KubernetesClientTest.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -100,21 +100,20 @@ void synchronousCall() throws ApiException {
100100
void handleErrorsInSyncCall() {
101101
mockWebServer.enqueue(
102102
HttpResponse.of(HttpStatus.valueOf(451), MediaType.PLAIN_TEXT_UTF_8, "42"));
103-
AtomicReference<ApiException> apiExceptionReference = new AtomicReference<>(null);
103+
ApiException exception = null;
104104
try {
105105
testing.runWithSpan(
106106
"parent",
107107
() -> {
108108
coreV1Api.connectGetNamespacedPodProxy("name", "namespace", "path");
109109
});
110110
} catch (ApiException e) {
111-
apiExceptionReference.set(e);
111+
exception = e;
112112
}
113-
assertThat(apiExceptionReference.get()).isNotNull();
113+
ApiException apiException = exception;
114+
assertThat(apiException).isNotNull();
114115
assertThat(mockWebServer.takeRequest().request().headers().get("traceparent")).isNotBlank();
115116

116-
ApiException apiException = apiExceptionReference.get();
117-
118117
testing.waitAndAssertTraces(
119118
trace ->
120119
trace.hasSpansSatisfyingExactly(

0 commit comments

Comments
 (0)