Skip to content

Commit e5c09c4

Browse files
committed
Format code
1 parent af762dd commit e5c09c4

File tree

9 files changed

+18
-29
lines changed

9 files changed

+18
-29
lines changed

sentry-android-ndk/src/main/java/io/sentry/android/ndk/NdkScopeObserver.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77
import io.sentry.SentryLevel;
88
import io.sentry.SentryOptions;
99
import io.sentry.SpanContext;
10-
import io.sentry.SpanId;
1110
import io.sentry.ndk.INativeScope;
1211
import io.sentry.ndk.NativeScope;
13-
import io.sentry.protocol.SentryId;
1412
import io.sentry.protocol.User;
1513
import io.sentry.util.Objects;
1614
import java.util.Locale;
@@ -132,12 +130,17 @@ public void removeExtra(final @NotNull String key) {
132130

133131
@Override
134132
public void setTrace(@Nullable SpanContext spanContext, @NotNull IScope scope) {
135-
if(spanContext == null) {
133+
if (spanContext == null) {
136134
return;
137135
}
138136

139137
try {
140-
options.getExecutorService().submit(() -> nativeScope.setTrace(spanContext.getTraceId().toString(), spanContext.getSpanId().toString()));
138+
options
139+
.getExecutorService()
140+
.submit(
141+
() ->
142+
nativeScope.setTrace(
143+
spanContext.getTraceId().toString(), spanContext.getSpanId().toString()));
141144
} catch (Throwable e) {
142145
options.getLogger().log(SentryLevel.ERROR, e, "Scope sync setTraceId failed.");
143146
}

sentry/src/main/java/io/sentry/HubAdapter.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,7 @@ public void reportFullyDisplayed() {
323323
}
324324

325325
@Override
326-
public void setTrace(
327-
final @NotNull String traceId, final @NotNull String spanId) {
326+
public void setTrace(final @NotNull String traceId, final @NotNull String spanId) {
328327
Sentry.setTrace(traceId, spanId);
329328
}
330329

sentry/src/main/java/io/sentry/HubScopesWrapper.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,7 @@ public void reportFullyDisplayed() {
317317
}
318318

319319
@Override
320-
public void setTrace(
321-
@NotNull String traceId, @NotNull String spanId) {
320+
public void setTrace(@NotNull String traceId, @NotNull String spanId) {
322321
scopes.setTrace(traceId, spanId);
323322
}
324323

sentry/src/main/java/io/sentry/NoOpHub.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,7 @@ public void reportFullyDisplayed() {}
277277
}
278278

279279
@Override
280-
public void setTrace(
281-
final @NotNull String traceID, final @NotNull String spanId) {}
280+
public void setTrace(final @NotNull String traceID, final @NotNull String spanId) {}
282281

283282
@Override
284283
public @Nullable SentryTraceHeader getTraceparent() {

sentry/src/main/java/io/sentry/NoOpScopes.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,7 @@ public void reportFullyDisplayed() {}
272272
}
273273

274274
@Override
275-
public void setTrace(
276-
final @NotNull String traceId, final @NotNull String spanId) { }
275+
public void setTrace(final @NotNull String traceId, final @NotNull String spanId) {}
277276

278277
@Override
279278
public @Nullable SentryTraceHeader getTraceparent() {

sentry/src/main/java/io/sentry/PropagationContext.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,9 @@ public static PropagationContext fromHeaders(
5252
}
5353

5454
public static @NotNull PropagationContext fromId(
55-
final @NotNull String traceId,
56-
final @NotNull String spanId) {
55+
final @NotNull String traceId, final @NotNull String spanId) {
5756
return new PropagationContext(
58-
new SentryId(traceId),
59-
new SpanId(),
60-
new SpanId(spanId),
61-
null,
62-
null
63-
);
57+
new SentryId(traceId), new SpanId(), new SpanId(spanId), null, null);
6458
}
6559

6660
private @NotNull SentryId traceId;

sentry/src/main/java/io/sentry/Scopes.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -975,10 +975,8 @@ public void reportFullyDisplayed() {
975975
}
976976

977977
@Override
978-
public void setTrace(
979-
final @NotNull String traceId, final @NotNull String spanID) {
980-
@NotNull
981-
PropagationContext propagationContext = PropagationContext.fromId(traceId, spanID);
978+
public void setTrace(final @NotNull String traceId, final @NotNull String spanID) {
979+
@NotNull PropagationContext propagationContext = PropagationContext.fromId(traceId, spanID);
982980
configureScope((scope) -> scope.setPropagationContext(propagationContext));
983981
}
984982

sentry/src/main/java/io/sentry/ScopesAdapter.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,8 @@ public void reportFullyDisplayed() {
322322
}
323323

324324
@Override
325-
public void setTrace(
326-
final @NotNull String traceId, final @NotNull String spanId) {
327-
Sentry.setTrace(traceId, spanId);
325+
public void setTrace(final @NotNull String traceId, final @NotNull String spanId) {
326+
Sentry.setTrace(traceId, spanId);
328327
}
329328

330329
@Override

sentry/src/main/java/io/sentry/Sentry.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,8 +1169,7 @@ public interface OptionsConfiguration<T extends SentryOptions> {
11691169
* @param spanId the span ID
11701170
*/
11711171
// return TransactionContext (if performance enabled) or null (if performance disabled)
1172-
public static void setTrace(
1173-
final @NotNull String traceId, final @NotNull String spanId) {
1172+
public static void setTrace(final @NotNull String traceId, final @NotNull String spanId) {
11741173
getCurrentScopes().setTrace(traceId, spanId);
11751174
}
11761175

0 commit comments

Comments
 (0)