Skip to content

Commit c1c005f

Browse files
Update errorProneVersion to v2.26.0 (#1221)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Lauri Tulmin <[email protected]>
1 parent 4427011 commit c1c005f

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

dependencyManagement/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ val DEPENDENCY_BOMS = listOf(
1919

2020
val autoServiceVersion = "1.1.1"
2121
val autoValueVersion = "1.10.4"
22-
val errorProneVersion = "2.25.0"
22+
val errorProneVersion = "2.26.0"
2323
val prometheusVersion = "0.16.0"
2424
val mockitoVersion = "4.11.0"
2525
val slf4jVersion = "2.0.12"

disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/internal/serialization/mapping/spans/SpanDataMapper.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ private static void addSpanDataExtras(
126126
}
127127

128128
private static StatusData mapStatusDataToSdk(Status source) {
129-
return StatusData.create(getStatusCode(source.code.getValue()), source.message);
129+
return StatusData.create(getStatusCode(source.code), source.message);
130130
}
131131

132132
private static Span.Event eventDataToProto(EventData source) {
@@ -269,13 +269,16 @@ private static int calculateRecordedItems(int droppedCount, int itemsCount) {
269269
return droppedCount + itemsCount;
270270
}
271271

272-
private static StatusCode getStatusCode(int ordinal) {
273-
for (StatusCode statusCode : StatusCode.values()) {
274-
if (statusCode.ordinal() == ordinal) {
275-
return statusCode;
276-
}
272+
private static StatusCode getStatusCode(Status.StatusCode source) {
273+
switch (source) {
274+
case STATUS_CODE_UNSET:
275+
return StatusCode.UNSET;
276+
case STATUS_CODE_OK:
277+
return StatusCode.OK;
278+
case STATUS_CODE_ERROR:
279+
return StatusCode.ERROR;
277280
}
278-
throw new IllegalArgumentException();
281+
throw new IllegalArgumentException("Unexpected enum constant: " + source);
279282
}
280283

281284
private static List<KeyValue> attributesToProto(Attributes source) {

0 commit comments

Comments
 (0)