Skip to content

Commit 830620c

Browse files
committed
spotless
1 parent a96709a commit 830620c

File tree

2 files changed

+23
-22
lines changed

2 files changed

+23
-22
lines changed

exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/Serializer.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,13 @@ public void serializeStringWithContext(
264264
return;
265265
}
266266
if (string.isEmpty()) {
267-
if(!allowEmpty){
267+
if (!allowEmpty) {
268268
return;
269269
}
270-
// if (allowEmpty) {
271-
// writeString(field, string, 0, context);
272-
// }
273-
// return;
270+
// if (allowEmpty) {
271+
// writeString(field, string, 0, context);
272+
// }
273+
// return;
274274
}
275275
if (context.marshalStringNoAllocation()) {
276276
writeString(field, string, context.getSize(), context);

exporters/otlp/common/src/test/java/io/opentelemetry/exporter/internal/otlp/traces/TraceRequestMarshalerTest.java

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,8 @@ void toProtoResourceSpans() {
112112
InstrumentationScopeInfo.builder("testLib")
113113
.setVersion("1.0")
114114
.setSchemaUrl("http://url")
115-
.setAttributes(Attributes.builder()
116-
.put("key", "value")
117-
.put("empty", "")
118-
.build())
115+
.setAttributes(
116+
Attributes.builder().put("key", "value").put("empty", "").build())
119117
.build())
120118
.setResource(
121119
Resource.builder().put("one", 1).setSchemaUrl("http://url").build())
@@ -133,19 +131,22 @@ void toProtoResourceSpans() {
133131
assertThat(scope.getName()).isEqualTo("testLib");
134132
assertThat(scope.getVersion()).isEqualTo("1.0");
135133
assertThat(scope.getAttributesCount()).isEqualTo(2);
136-
List<KeyValue> attributes = scope.getAttributesList().stream()
137-
.sorted(Comparator.comparing(KeyValue::getKey)).collect(
138-
Collectors.toList());
139-
assertThat(attributes.get(0)).isEqualTo(
140-
KeyValue.newBuilder()
141-
.setKey("empty")
142-
.setValue(AnyValue.newBuilder().setStringValue("").build())
143-
.build());
144-
assertThat(attributes.get(1)).isEqualTo(
145-
KeyValue.newBuilder()
146-
.setKey("key")
147-
.setValue(AnyValue.newBuilder().setStringValue("value").build())
148-
.build());
134+
List<KeyValue> attributes =
135+
scope.getAttributesList().stream()
136+
.sorted(Comparator.comparing(KeyValue::getKey))
137+
.collect(Collectors.toList());
138+
assertThat(attributes.get(0))
139+
.isEqualTo(
140+
KeyValue.newBuilder()
141+
.setKey("empty")
142+
.setValue(AnyValue.newBuilder().setStringValue("").build())
143+
.build());
144+
assertThat(attributes.get(1))
145+
.isEqualTo(
146+
KeyValue.newBuilder()
147+
.setKey("key")
148+
.setValue(AnyValue.newBuilder().setStringValue("value").build())
149+
.build());
149150
}
150151

151152
@ParameterizedTest

0 commit comments

Comments
 (0)