Skip to content

Commit ded95ea

Browse files
fix(deps): update errorproneversion to v2.42.0 (#7684)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: jwatson <[email protected]>
1 parent 8361d44 commit ded95ea

File tree

3 files changed

+32
-29
lines changed

3 files changed

+32
-29
lines changed

api/all/src/test/java/io/opentelemetry/api/common/AttributesTest.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,14 @@ void nullsAreNoOps() {
421421
builder.put("long", 10);
422422
builder.put("double", 1.0);
423423
builder.put("bool", true);
424-
builder.put("arrayString", new String[] {"string"});
425-
builder.put("arrayLong", new long[] {10L});
426-
builder.put("arrayDouble", new double[] {1.0});
427-
builder.put("arrayBool", new boolean[] {true});
424+
String[] strings = {"string"};
425+
builder.put("arrayString", strings);
426+
long[] longs = {10L};
427+
builder.put("arrayLong", longs);
428+
double[] doubles = {1.0};
429+
builder.put("arrayDouble", doubles);
430+
boolean[] booleans = {true};
431+
builder.put("arrayBool", booleans);
428432
assertThat(builder.build().size()).isEqualTo(9);
429433

430434
// note: currently these are no-op calls; that behavior is not required, so if it needs to

dependencyManagement/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ rootProject.extra["versions"] = dependencyVersions
99

1010

1111
val autoValueVersion = "1.11.0"
12-
val errorProneVersion = "2.41.0"
12+
val errorProneVersion = "2.42.0"
1313
val jmhVersion = "1.37"
1414
// Mockito 5.x.x requires Java 11 https://github.com/mockito/mockito/releases/tag/v5.0.0
1515
val mockitoVersion = "4.11.0"

sdk/trace/src/test/java/io/opentelemetry/sdk/trace/SdkSpanTest.java

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import static io.opentelemetry.api.common.AttributeKey.stringKey;
1616
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat;
1717
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
18+
import static java.util.Collections.singletonList;
1819
import static java.util.stream.Collectors.joining;
1920
import static org.assertj.core.api.Assertions.assertThatCode;
2021
import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -135,7 +136,7 @@ void nothingChangedAfterEnd() {
135136
spanData,
136137
Attributes.empty(),
137138
Collections.emptyList(),
138-
Collections.singletonList(link),
139+
singletonList(link),
139140
SPAN_NAME,
140141
START_EPOCH_NANOS,
141142
START_EPOCH_NANOS,
@@ -251,8 +252,8 @@ void toSpanData_ActiveSpan() {
251252
verifySpanData(
252253
spanData,
253254
expectedAttributes,
254-
Collections.singletonList(event),
255-
Collections.singletonList(link),
255+
singletonList(event),
256+
singletonList(link),
256257
SPAN_NEW_NAME,
257258
START_EPOCH_NANOS,
258259
0,
@@ -282,8 +283,8 @@ void toSpanData_EndedSpan() {
282283
verifySpanData(
283284
spanData,
284285
expectedAttributes,
285-
Collections.singletonList(event),
286-
Collections.singletonList(link),
286+
singletonList(event),
287+
singletonList(link),
287288
SPAN_NEW_NAME,
288289
START_EPOCH_NANOS,
289290
testClock.now(),
@@ -466,7 +467,8 @@ void getAttributes_Empty() {
466467
}
467468

468469
@Test
469-
@SuppressWarnings("deprecation") // Testing deprecated code
470+
@SuppressWarnings("deprecation")
471+
// Testing deprecated code
470472
void getInstrumentationLibraryInfo() {
471473
SdkSpan span = createTestSpan(SpanKind.CLIENT);
472474
try {
@@ -552,13 +554,10 @@ void setAttribute() {
552554
span.setAttribute(doubleArrayKey("NullArrayDoubleKey"), null);
553555
span.setAttribute(booleanArrayKey("NullArrayBooleanKey"), null);
554556
// These should be maintained
555-
span.setAttribute(longArrayKey("ArrayWithNullLongKey"), Arrays.asList(new Long[] {null}));
556-
span.setAttribute(
557-
stringArrayKey("ArrayWithNullStringKey"), Arrays.asList(new String[] {null}));
558-
span.setAttribute(
559-
doubleArrayKey("ArrayWithNullDoubleKey"), Arrays.asList(new Double[] {null}));
560-
span.setAttribute(
561-
booleanArrayKey("ArrayWithNullBooleanKey"), Arrays.asList(new Boolean[] {null}));
557+
span.setAttribute(longArrayKey("ArrayWithNullLongKey"), singletonList(null));
558+
span.setAttribute(stringArrayKey("ArrayWithNullStringKey"), singletonList(null));
559+
span.setAttribute(doubleArrayKey("ArrayWithNullDoubleKey"), singletonList(null));
560+
span.setAttribute(booleanArrayKey("ArrayWithNullBooleanKey"), singletonList(null));
562561
} finally {
563562
span.end();
564563
}
@@ -691,10 +690,10 @@ void setAllAttributes() {
691690
.put(doubleArrayKey("NullArrayDoubleKey"), (Double[]) null)
692691
.put(booleanArrayKey("NullArrayBooleanKey"), (Boolean[]) null)
693692
// These should be maintained
694-
.put(longArrayKey("ArrayWithNullLongKey"), Arrays.asList(new Long[] {null}))
695-
.put(stringArrayKey("ArrayWithNullStringKey"), Arrays.asList(new String[] {null}))
696-
.put(doubleArrayKey("ArrayWithNullDoubleKey"), Arrays.asList(new Double[] {null}))
697-
.put(booleanArrayKey("ArrayWithNullBooleanKey"), Arrays.asList(new Boolean[] {null}))
693+
.put(longArrayKey("ArrayWithNullLongKey"), singletonList(null))
694+
.put(stringArrayKey("ArrayWithNullStringKey"), singletonList(null))
695+
.put(doubleArrayKey("ArrayWithNullDoubleKey"), singletonList(null))
696+
.put(booleanArrayKey("ArrayWithNullBooleanKey"), singletonList(null))
698697
.build();
699698

700699
try {
@@ -1315,7 +1314,7 @@ public void setExceptionAttributes(
13151314
SpanLimits.getDefault(),
13161315
parentSpanId,
13171316
null,
1318-
Collections.singletonList(link),
1317+
singletonList(link),
13191318
exceptionAttributeResolver);
13201319

13211320
span.recordException(new IllegalStateException("error"));
@@ -1462,7 +1461,7 @@ private SdkSpan createTestSpanWithAttributes(Map<AttributeKey, Object> attribute
14621461
SpanLimits.getDefault(),
14631462
null,
14641463
attributesMap,
1465-
Collections.singletonList(link),
1464+
singletonList(link),
14661465
ExceptionAttributeResolver.getDefault());
14671466
}
14681467

@@ -1472,7 +1471,7 @@ private SdkSpan createTestRootSpan() {
14721471
SpanLimits.getDefault(),
14731472
SpanId.getInvalid(),
14741473
null,
1475-
Collections.singletonList(link),
1474+
singletonList(link),
14761475
ExceptionAttributeResolver.getDefault());
14771476
}
14781477

@@ -1482,7 +1481,7 @@ private SdkSpan createTestSpan(SpanKind kind) {
14821481
SpanLimits.getDefault(),
14831482
parentSpanId,
14841483
null,
1485-
Collections.singletonList(link),
1484+
singletonList(link),
14861485
ExceptionAttributeResolver.getDefault());
14871486
}
14881487

@@ -1492,7 +1491,7 @@ private SdkSpan createTestSpan(SpanLimits config) {
14921491
config,
14931492
parentSpanId,
14941493
null,
1495-
Collections.singletonList(link),
1494+
singletonList(link),
14961495
ExceptionAttributeResolver.getDefault());
14971496
}
14981497

@@ -1611,7 +1610,7 @@ void testAsSpanData() {
16111610
clock,
16121611
resource,
16131612
attributesWithCapacity,
1614-
Collections.singletonList(link1),
1613+
singletonList(link1),
16151614
1,
16161615
0);
16171616
long startEpochNanos = clock.now();
@@ -1638,7 +1637,7 @@ void testAsSpanData() {
16381637
result,
16391638
attributesWithCapacity,
16401639
events,
1641-
Collections.singletonList(link1),
1640+
singletonList(link1),
16421641
name,
16431642
startEpochNanos,
16441643
endEpochNanos,

0 commit comments

Comments
 (0)