Skip to content

Commit c885982

Browse files
fix(deps): update errorproneversion to v2.25.0 (main) (minor) (#10593)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Lauri Tulmin <[email protected]>
1 parent 670e094 commit c885982

File tree

6 files changed

+34
-14
lines changed

6 files changed

+34
-14
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package com.google.errorprone.bugpatterns.checkreturnvalue;
7+
8+
import com.google.errorprone.ErrorProneFlags;
9+
10+
public final class CanIgnoreReturnValueSuggesterFactory {
11+
12+
// calls package private constructor of CanIgnoreReturnValueSuggester
13+
public static CanIgnoreReturnValueSuggester createCanIgnoreReturnValueSuggester(
14+
ErrorProneFlags errorProneFlags) {
15+
return new CanIgnoreReturnValueSuggester(errorProneFlags);
16+
}
17+
18+
private CanIgnoreReturnValueSuggesterFactory() {}
19+
}

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import com.google.errorprone.VisitorState;
1414
import com.google.errorprone.bugpatterns.BugChecker;
1515
import com.google.errorprone.bugpatterns.checkreturnvalue.CanIgnoreReturnValueSuggester;
16+
import com.google.errorprone.bugpatterns.checkreturnvalue.CanIgnoreReturnValueSuggesterFactory;
1617
import com.google.errorprone.matchers.Description;
1718
import com.google.inject.Inject;
1819
import com.sun.source.tree.ClassTree;
@@ -33,7 +34,8 @@ public class OtelCanIgnoreReturnValueSuggester extends BugChecker
3334

3435
@Inject
3536
OtelCanIgnoreReturnValueSuggester(ErrorProneFlags errorProneFlags) {
36-
delegate = new CanIgnoreReturnValueSuggester(errorProneFlags);
37+
delegate =
38+
CanIgnoreReturnValueSuggesterFactory.createCanIgnoreReturnValueSuggester(errorProneFlags);
3739
}
3840

3941
public OtelCanIgnoreReturnValueSuggester() {

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.24.1"
42+
val errorProneVersion = "2.25.0"
4343
val byteBuddyVersion = "1.14.12"
4444
val asmVersion = "9.6"
4545
val jmhVersion = "1.37"

instrumentation/opentelemetry-extension-annotations-1.0/javaagent/src/test/java/io/opentelemetry/test/annotation/WithSpanInstrumentationTest.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
package io.opentelemetry.test.annotation;
77

88
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat;
9-
import static org.assertj.core.api.Assertions.assertThat;
109
import static org.assertj.core.api.Assertions.entry;
1110

1211
import io.opentelemetry.api.common.AttributeKey;
@@ -158,7 +157,7 @@ void excludedMethod() throws Exception {
158157
new TracedWithSpan().ignored();
159158

160159
Thread.sleep(500); // sleep a bit just to make sure no span is captured
161-
assertThat(testing.waitForTraces(0));
160+
assertThat(testing.waitForTraces(0)).isEmpty();
162161
}
163162

164163
@Test
@@ -253,7 +252,7 @@ void completingCompletionStage() throws Exception {
253252
new TracedWithSpan().completionStage(future);
254253

255254
Thread.sleep(500); // sleep a bit just to make sure no span is captured
256-
assertThat(testing.waitForTraces(0));
255+
assertThat(testing.waitForTraces(0)).isEmpty();
257256

258257
future.complete("Done");
259258

@@ -286,7 +285,7 @@ void exceptionallyCompletingCompletionStage() throws Exception {
286285
new TracedWithSpan().completionStage(future);
287286

288287
Thread.sleep(500); // sleep a bit just to make sure no span is captured
289-
assertThat(testing.waitForTraces(0));
288+
assertThat(testing.waitForTraces(0)).isEmpty();
290289

291290
future.completeExceptionally(new IllegalArgumentException("Boom"));
292291

@@ -405,7 +404,7 @@ void completingCompletableFuture() throws Exception {
405404
new TracedWithSpan().completableFuture(future);
406405

407406
Thread.sleep(500); // sleep a bit just to make sure no span is captured
408-
assertThat(testing.waitForTraces(0));
407+
assertThat(testing.waitForTraces(0)).isEmpty();
409408

410409
future.complete("Done");
411410

@@ -438,7 +437,7 @@ void exceptionallyCompletingCompletableFuture() throws Exception {
438437
new TracedWithSpan().completableFuture(future);
439438

440439
Thread.sleep(500); // sleep a bit just to make sure no span is captured
441-
assertThat(testing.waitForTraces(0));
440+
assertThat(testing.waitForTraces(0)).isEmpty();
442441

443442
future.completeExceptionally(new IllegalArgumentException("Boom"));
444443

instrumentation/opentelemetry-instrumentation-annotations-1.16/javaagent/src/test/java/io/opentelemetry/test/annotation/AddingSpanAttributesInstrumentationTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void noExistingSpan() throws Exception {
101101

102102
new ExtractAttributesUsingAddingSpanAttributes().withSpanAttributes("foo", "bar", null, "baz");
103103

104-
assertThat(testing.waitForTraces(0));
104+
assertThat(testing.waitForTraces(0)).isEmpty();
105105
}
106106

107107
@Test

instrumentation/opentelemetry-instrumentation-annotations-1.16/javaagent/src/test/java/io/opentelemetry/test/annotation/WithSpanInstrumentationTest.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ void excludedMethod() throws Exception {
158158
new TracedWithSpan().ignored();
159159

160160
Thread.sleep(500); // sleep a bit just to make sure no span is captured
161-
assertThat(testing.waitForTraces(0));
161+
assertThat(testing.waitForTraces(0)).isEmpty();
162162
}
163163

164164
@Test
@@ -253,7 +253,7 @@ void completingCompletionStage() throws Exception {
253253
new TracedWithSpan().completionStage(future);
254254

255255
Thread.sleep(500); // sleep a bit just to make sure no span is captured
256-
assertThat(testing.waitForTraces(0));
256+
assertThat(testing.waitForTraces(0)).isEmpty();
257257

258258
future.complete("Done");
259259

@@ -286,7 +286,7 @@ void exceptionallyCompletingCompletionStage() throws Exception {
286286
new TracedWithSpan().completionStage(future);
287287

288288
Thread.sleep(500); // sleep a bit just to make sure no span is captured
289-
assertThat(testing.waitForTraces(0));
289+
assertThat(testing.waitForTraces(0)).isEmpty();
290290

291291
future.completeExceptionally(new IllegalArgumentException("Boom"));
292292

@@ -405,7 +405,7 @@ void completingCompletableFuture() throws Exception {
405405
new TracedWithSpan().completableFuture(future);
406406

407407
Thread.sleep(500); // sleep a bit just to make sure no span is captured
408-
assertThat(testing.waitForTraces(0));
408+
assertThat(testing.waitForTraces(0)).isEmpty();
409409

410410
future.complete("Done");
411411

@@ -438,7 +438,7 @@ void exceptionallyCompletingCompletableFuture() throws Exception {
438438
new TracedWithSpan().completableFuture(future);
439439

440440
Thread.sleep(500); // sleep a bit just to make sure no span is captured
441-
assertThat(testing.waitForTraces(0));
441+
assertThat(testing.waitForTraces(0)).isEmpty();
442442

443443
future.completeExceptionally(new IllegalArgumentException("Boom"));
444444

0 commit comments

Comments
 (0)