Skip to content

Fix javadoc examples in context propagation interfaces - #8715

Merged
jack-berg merged 1 commit into
open-telemetry:mainfrom
thswlsqls:docs/fix-context-propagation-javadoc-examples
Aug 11, 2026
Merged

Fix javadoc examples in context propagation interfaces#8715
jack-berg merged 1 commit into
open-telemetry:mainfrom
thswlsqls:docs/fix-context-propagation-javadoc-examples

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Description

  • The class javadoc examples on TextMapPropagator and ContextPropagators use pre-1.0 API names, so copying them does not compile.
  • Setter/Getter no longer exist: the types are TextMapSetter<C>/TextMapGetter<C>, and the setter method is set, not put.
  • The server example implemented only get (with no return) and omitted the required keys; it now mirrors ExtendedContextPropagators.TEXT_MAP_GETTER.
  • Context.Key, Context.key(...), ContextKey.get(context) and context.withValue(...) become ContextKey.named(...), context.get(key) and context.with(key, value).
  • MyConcernPropagator was missing the class keyword, used an undeclared concern, and did not implement the abstract fields().
  • HttpTraceContext was removed in 1.0; the composite example now uses W3CTraceContextPropagator.getInstance().
  • Incomplete fix of Javadoc code snippets use methods that don't exist #4140, which touched this same ContextPropagators block but left Setter/Getter/HttpTraceContext behind.

Testing done

  • Docs-only, test-exempt: ./gradlew :context:check passed, and docs/apidiffs/current_vs_latest/*.txt is unchanged.
  • Compiled the corrected examples with javac against :context and :api:all — every type and signature resolves.
  • ./gradlew :context:javadoc --rerun-tasks — BUILD SUCCESSFUL, no invalid-tag in the generated HTML.

@thswlsqls
thswlsqls marked this pull request as ready for review August 10, 2026 00:40
@thswlsqls
thswlsqls requested a review from a team as a code owner August 10, 2026 00:40
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Aug 10, 2026

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-08-11 18:15 UTC

Status above doesn't look right?
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.65%. Comparing base (d948e13) to head (24b1f42).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8715   +/-   ##
=========================================
  Coverage     91.65%   91.65%           
- Complexity    10352    10353    +1     
=========================================
  Files          1003     1003           
  Lines         27210    27210           
  Branches       3199     3199           
=========================================
+ Hits          24939    24940    +1     
  Misses         1566     1566           
+ Partials        705      704    -1     

☔ 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.

@jack-berg
jack-berg merged commit bcdc790 into open-telemetry:main Aug 11, 2026
33 checks passed
@otelbot

otelbot Bot commented Aug 11, 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.

@thswlsqls
thswlsqls deleted the docs/fix-context-propagation-javadoc-examples branch August 13, 2026 04:31
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