Skip to content

Fix dead API reference in rationale.md try-with-resources example#8488

Merged
jack-berg merged 1 commit into
open-telemetry:mainfrom
thswlsqls:docs/fix-rationale-makecurrent-example
Jun 22, 2026
Merged

Fix dead API reference in rationale.md try-with-resources example#8488
jack-berg merged 1 commit into
open-telemetry:mainfrom
thswlsqls:docs/fix-rationale-makecurrent-example

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Description

  • The "Span not Closeable" example in docs/rationale.md calls TracingContextUtils.currentContextWith(span). Neither that class nor the currentContextWith method exists in the codebase (confirmed via grep), so copy-pasting the example does not compile.
  • Since Span extends ImplicitContextKeyed, span.makeCurrent() returns a Scope — the current API that fits try-with-resources directly.
  • The sibling doc docs/sdk-configuration-design.md already uses the try (Scope ignored = span.makeCurrent()) pattern; this PR aligns the example with it.

Testing done

  • Docs-only change (1 line in docs/rationale.md). No behavior change → no new tests, not a Gradle build target.
  • Confirmed in context/.../ImplicitContextKeyed.java that span.makeCurrent() returns Scope, matching the example's try (Scope scope = ...).
  • No apidiff / CHANGELOG change (not a public API or user-facing behavior change).

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 20, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: thswlsqls / name: Eunbin Son (d65cea0)

@thswlsqls thswlsqls marked this pull request as ready for review June 20, 2026 00:10
@thswlsqls thswlsqls requested a review from a team as a code owner June 20, 2026 00:10
@codecov

codecov Bot commented Jun 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.77%. Comparing base (824334c) to head (d65cea0).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8488   +/-   ##
=========================================
  Coverage     78.77%   78.77%           
  Complexity     8579     8579           
=========================================
  Files          1009     1009           
  Lines         28993    28993           
  Branches       3599     3599           
=========================================
  Hits          22839    22839           
  Misses         5311     5311           
  Partials        843      843           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thswlsqls

Copy link
Copy Markdown
Contributor Author

/easycla

jack-berg
jack-berg approved these changes Jun 22, 2026
@jack-berg jack-berg merged commit 271c8dc into open-telemetry:main Jun 22, 2026
29 checks passed
@otelbot

otelbot Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution @thswlsqls! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants