Skip to content

Commit a8a9508

Browse files
committed
spotless
1 parent 3b3b92c commit a8a9508

File tree

1 file changed

+36
-37
lines changed

1 file changed

+36
-37
lines changed

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

Lines changed: 36 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,14 @@ void onEnding_spanStillMutable() {
162162

163163
AtomicBoolean endedStateInProcessor = new AtomicBoolean();
164164
doAnswer(
165-
invocation -> {
166-
ReadWriteSpan sp = invocation.getArgument(0, ReadWriteSpan.class);
167-
assertThat(sp.hasEnded()).isFalse();
168-
sp.end(); // should have no effect, nested end should be detected
169-
endedStateInProcessor.set(sp.hasEnded());
170-
sp.setAttribute(dummyAttrib, "bar");
171-
return null;
172-
})
165+
invocation -> {
166+
ReadWriteSpan sp = invocation.getArgument(0, ReadWriteSpan.class);
167+
assertThat(sp.hasEnded()).isFalse();
168+
sp.end(); // should have no effect, nested end should be detected
169+
endedStateInProcessor.set(sp.hasEnded());
170+
sp.setAttribute(dummyAttrib, "bar");
171+
return null;
172+
})
173173
.when(spanProcessor)
174174
.onEnding(any());
175175

@@ -188,21 +188,21 @@ void onEnding_concurrentModificationsPrevented() {
188188
AttributeKey<String> concurrentAttrib = AttributeKey.stringKey("concurrent_foo");
189189

190190
doAnswer(
191-
invocation -> {
192-
ReadWriteSpan sp = invocation.getArgument(0, ReadWriteSpan.class);
191+
invocation -> {
192+
ReadWriteSpan sp = invocation.getArgument(0, ReadWriteSpan.class);
193193

194-
Thread concurrent =
195-
new Thread(
196-
() -> {
197-
sp.setAttribute(concurrentAttrib, "concurrent_bar");
198-
});
199-
concurrent.start();
200-
concurrent.join();
194+
Thread concurrent =
195+
new Thread(
196+
() -> {
197+
sp.setAttribute(concurrentAttrib, "concurrent_bar");
198+
});
199+
concurrent.start();
200+
concurrent.join();
201201

202-
sp.setAttribute(syncAttrib, "sync_bar");
202+
sp.setAttribute(syncAttrib, "sync_bar");
203203

204-
return null;
205-
})
204+
return null;
205+
})
206206
.when(spanProcessor)
207207
.onEnding(any());
208208

@@ -218,13 +218,13 @@ void onEnding_latencyPinned() {
218218

219219
AtomicLong spanLatencyInProcessor = new AtomicLong();
220220
doAnswer(
221-
invocation -> {
222-
ReadWriteSpan sp = invocation.getArgument(0, ReadWriteSpan.class);
221+
invocation -> {
222+
ReadWriteSpan sp = invocation.getArgument(0, ReadWriteSpan.class);
223223

224-
testClock.advance(Duration.ofSeconds(100));
225-
spanLatencyInProcessor.set(sp.getLatencyNanos());
226-
return null;
227-
})
224+
testClock.advance(Duration.ofSeconds(100));
225+
spanLatencyInProcessor.set(sp.getLatencyNanos());
226+
return null;
227+
})
228228
.when(spanProcessor)
229229
.onEnding(any());
230230

@@ -307,7 +307,7 @@ void toSpanData_immutableEvents() {
307307
SpanData spanData = span.toSpanData();
308308

309309
assertThatThrownBy(
310-
() -> spanData.getEvents().add(EventData.create(1000, "test", Attributes.empty())))
310+
() -> spanData.getEvents().add(EventData.create(1000, "test", Attributes.empty())))
311311
.isInstanceOf(UnsupportedOperationException.class);
312312
}
313313

@@ -318,7 +318,7 @@ void toSpanData_immutableEvents_ended() {
318318
SpanData spanData = span.toSpanData();
319319

320320
assertThatThrownBy(
321-
() -> spanData.getEvents().add(EventData.create(1000, "test", Attributes.empty())))
321+
() -> spanData.getEvents().add(EventData.create(1000, "test", Attributes.empty())))
322322
.isInstanceOf(UnsupportedOperationException.class);
323323
}
324324

@@ -468,7 +468,7 @@ void getAttributes_Empty() {
468468

469469
@Test
470470
@SuppressWarnings("deprecation")
471-
// Testing deprecated code
471+
// Testing deprecated code
472472
void getInstrumentationLibraryInfo() {
473473
SdkSpan span = createTestSpan(SpanKind.CLIENT);
474474
try {
@@ -1373,8 +1373,8 @@ void onStartOnEndNotRequired() {
13731373
SpanKind.INTERNAL,
13741374
parentSpanId != null
13751375
? Span.wrap(
1376-
SpanContext.create(
1377-
traceId, parentSpanId, TraceFlags.getDefault(), TraceState.getDefault()))
1376+
SpanContext.create(
1377+
traceId, parentSpanId, TraceFlags.getDefault(), TraceState.getDefault()))
13781378
: Span.getInvalid(),
13791379
Context.root(),
13801380
spanLimits,
@@ -1404,8 +1404,7 @@ void setStatus(Consumer<Span> spanConsumer, StatusData expectedSpanData) {
14041404
private static Stream<Arguments> setStatusArgs() {
14051405
return Stream.of(
14061406
// Default status is UNSET
1407-
Arguments.of(spanConsumer(span -> {
1408-
}), StatusData.unset()),
1407+
Arguments.of(spanConsumer(span -> {}), StatusData.unset()),
14091408
// Simple cases
14101409
Arguments.of(spanConsumer(span -> span.setStatus(StatusCode.OK)), StatusData.ok()),
14111410
Arguments.of(spanConsumer(span -> span.setStatus(StatusCode.ERROR)), StatusData.error()),
@@ -1513,8 +1512,8 @@ private SdkSpan createTestSpan(
15131512
kind,
15141513
parentSpanId != null
15151514
? Span.wrap(
1516-
SpanContext.create(
1517-
traceId, parentSpanId, TraceFlags.getDefault(), TraceState.getDefault()))
1515+
SpanContext.create(
1516+
traceId, parentSpanId, TraceFlags.getDefault(), TraceState.getDefault()))
15181517
: Span.getInvalid(),
15191518
Context.root(),
15201519
config,
@@ -1601,8 +1600,8 @@ void testAsSpanData() {
16011600
kind,
16021601
parentSpanId != null
16031602
? Span.wrap(
1604-
SpanContext.create(
1605-
traceId, parentSpanId, TraceFlags.getDefault(), TraceState.getDefault()))
1603+
SpanContext.create(
1604+
traceId, parentSpanId, TraceFlags.getDefault(), TraceState.getDefault()))
16061605
: Span.getInvalid(),
16071606
Context.root(),
16081607
spanLimits,

0 commit comments

Comments
 (0)