Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,14 @@ void nullsAreNoOps() {
builder.put("long", 10);
builder.put("double", 1.0);
builder.put("bool", true);
builder.put("arrayString", new String[] {"string"});
builder.put("arrayLong", new long[] {10L});
builder.put("arrayDouble", new double[] {1.0});
builder.put("arrayBool", new boolean[] {true});
String[] strings = {"string"};
builder.put("arrayString", strings);
long[] longs = {10L};
builder.put("arrayLong", longs);
double[] doubles = {1.0};
builder.put("arrayDouble", doubles);
boolean[] booleans = {true};
builder.put("arrayBool", booleans);
assertThat(builder.build().size()).isEqualTo(9);

// note: currently these are no-op calls; that behavior is not required, so if it needs to
Expand Down
2 changes: 1 addition & 1 deletion dependencyManagement/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ rootProject.extra["versions"] = dependencyVersions


val autoValueVersion = "1.11.0"
val errorProneVersion = "2.41.0"
val errorProneVersion = "2.42.0"
val jmhVersion = "1.37"
// Mockito 5.x.x requires Java 11 https://github.com/mockito/mockito/releases/tag/v5.0.0
val mockitoVersion = "4.11.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import static io.opentelemetry.api.common.AttributeKey.stringKey;
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat;
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
import static java.util.Collections.singletonList;
import static java.util.stream.Collectors.joining;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
Expand Down Expand Up @@ -135,7 +136,7 @@ void nothingChangedAfterEnd() {
spanData,
Attributes.empty(),
Collections.emptyList(),
Collections.singletonList(link),
singletonList(link),
SPAN_NAME,
START_EPOCH_NANOS,
START_EPOCH_NANOS,
Expand Down Expand Up @@ -251,8 +252,8 @@ void toSpanData_ActiveSpan() {
verifySpanData(
spanData,
expectedAttributes,
Collections.singletonList(event),
Collections.singletonList(link),
singletonList(event),
singletonList(link),
SPAN_NEW_NAME,
START_EPOCH_NANOS,
0,
Expand Down Expand Up @@ -282,8 +283,8 @@ void toSpanData_EndedSpan() {
verifySpanData(
spanData,
expectedAttributes,
Collections.singletonList(event),
Collections.singletonList(link),
singletonList(event),
singletonList(link),
SPAN_NEW_NAME,
START_EPOCH_NANOS,
testClock.now(),
Expand Down Expand Up @@ -466,7 +467,8 @@ void getAttributes_Empty() {
}

@Test
@SuppressWarnings("deprecation") // Testing deprecated code
@SuppressWarnings("deprecation")
// Testing deprecated code
void getInstrumentationLibraryInfo() {
SdkSpan span = createTestSpan(SpanKind.CLIENT);
try {
Expand Down Expand Up @@ -552,13 +554,10 @@ void setAttribute() {
span.setAttribute(doubleArrayKey("NullArrayDoubleKey"), null);
span.setAttribute(booleanArrayKey("NullArrayBooleanKey"), null);
// These should be maintained
span.setAttribute(longArrayKey("ArrayWithNullLongKey"), Arrays.asList(new Long[] {null}));
span.setAttribute(
stringArrayKey("ArrayWithNullStringKey"), Arrays.asList(new String[] {null}));
span.setAttribute(
doubleArrayKey("ArrayWithNullDoubleKey"), Arrays.asList(new Double[] {null}));
span.setAttribute(
booleanArrayKey("ArrayWithNullBooleanKey"), Arrays.asList(new Boolean[] {null}));
span.setAttribute(longArrayKey("ArrayWithNullLongKey"), singletonList(null));
span.setAttribute(stringArrayKey("ArrayWithNullStringKey"), singletonList(null));
span.setAttribute(doubleArrayKey("ArrayWithNullDoubleKey"), singletonList(null));
span.setAttribute(booleanArrayKey("ArrayWithNullBooleanKey"), singletonList(null));
} finally {
span.end();
}
Expand Down Expand Up @@ -691,10 +690,10 @@ void setAllAttributes() {
.put(doubleArrayKey("NullArrayDoubleKey"), (Double[]) null)
.put(booleanArrayKey("NullArrayBooleanKey"), (Boolean[]) null)
// These should be maintained
.put(longArrayKey("ArrayWithNullLongKey"), Arrays.asList(new Long[] {null}))
.put(stringArrayKey("ArrayWithNullStringKey"), Arrays.asList(new String[] {null}))
.put(doubleArrayKey("ArrayWithNullDoubleKey"), Arrays.asList(new Double[] {null}))
.put(booleanArrayKey("ArrayWithNullBooleanKey"), Arrays.asList(new Boolean[] {null}))
.put(longArrayKey("ArrayWithNullLongKey"), singletonList(null))
.put(stringArrayKey("ArrayWithNullStringKey"), singletonList(null))
.put(doubleArrayKey("ArrayWithNullDoubleKey"), singletonList(null))
.put(booleanArrayKey("ArrayWithNullBooleanKey"), singletonList(null))
.build();

try {
Expand Down Expand Up @@ -1315,7 +1314,7 @@ public void setExceptionAttributes(
SpanLimits.getDefault(),
parentSpanId,
null,
Collections.singletonList(link),
singletonList(link),
exceptionAttributeResolver);

span.recordException(new IllegalStateException("error"));
Expand Down Expand Up @@ -1462,7 +1461,7 @@ private SdkSpan createTestSpanWithAttributes(Map<AttributeKey, Object> attribute
SpanLimits.getDefault(),
null,
attributesMap,
Collections.singletonList(link),
singletonList(link),
ExceptionAttributeResolver.getDefault());
}

Expand All @@ -1472,7 +1471,7 @@ private SdkSpan createTestRootSpan() {
SpanLimits.getDefault(),
SpanId.getInvalid(),
null,
Collections.singletonList(link),
singletonList(link),
ExceptionAttributeResolver.getDefault());
}

Expand All @@ -1482,7 +1481,7 @@ private SdkSpan createTestSpan(SpanKind kind) {
SpanLimits.getDefault(),
parentSpanId,
null,
Collections.singletonList(link),
singletonList(link),
ExceptionAttributeResolver.getDefault());
}

Expand All @@ -1492,7 +1491,7 @@ private SdkSpan createTestSpan(SpanLimits config) {
config,
parentSpanId,
null,
Collections.singletonList(link),
singletonList(link),
ExceptionAttributeResolver.getDefault());
}

Expand Down Expand Up @@ -1611,7 +1610,7 @@ void testAsSpanData() {
clock,
resource,
attributesWithCapacity,
Collections.singletonList(link1),
singletonList(link1),
1,
0);
long startEpochNanos = clock.now();
Expand All @@ -1638,7 +1637,7 @@ void testAsSpanData() {
result,
attributesWithCapacity,
events,
Collections.singletonList(link1),
singletonList(link1),
name,
startEpochNanos,
endEpochNanos,
Expand Down
Loading