Skip to content

Commit

Permalink
Changes following the review
Browse files Browse the repository at this point in the history
  • Loading branch information
marcingrzejszczak committed Jul 12, 2023
1 parent 3962d72 commit cdab30b
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,24 +129,25 @@ static class WrappedScope implements Scope {

final io.opentelemetry.context.Scope scope;

final OtelTraceContext otelTraceContext;
final OtelTraceContext currentOtelTraceContext;

final Context old;
final Context oldContext;

WrappedScope(io.opentelemetry.context.Scope scope) {
this(scope, null, null);
}

WrappedScope(io.opentelemetry.context.Scope scope, OtelTraceContext otelTraceContext, Context old) {
WrappedScope(io.opentelemetry.context.Scope scope, OtelTraceContext currentOtelTraceContext,
Context oldContext) {
this.scope = scope;
this.otelTraceContext = otelTraceContext;
this.old = old;
this.currentOtelTraceContext = currentOtelTraceContext;
this.oldContext = oldContext;
}

@Override
public void close() {
if (this.otelTraceContext != null) {
otelTraceContext.updateContext(old);
if (this.currentOtelTraceContext != null) {
currentOtelTraceContext.updateContext(oldContext);
}
this.scope.close();
}
Expand Down

0 comments on commit cdab30b

Please sign in to comment.