Skip to content

Fix StringEncoder javadoc implementation priority order#8621

Open
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:docs/string-encoder-priority-order
Open

Fix StringEncoder javadoc implementation priority order#8621
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:docs/string-encoder-priority-order

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Fixes #8620

Description

  • The StringEncoder javadoc listed VarHandleStringEncoder before UnsafeStringEncoder, but StringEncoderHolder.createInstance() tries Unsafe first — its inline comment says "so try it first" because Unsafe is faster.
  • Reordered the list to match the code, and noted that Unsafe is only attempted when the Java version is detected to be below 23, which is what proactivelyAvoidUnsafe() does to avoid the JEP 498 deprecation warning.
  • Also noted that VarHandle requires --add-opens=java.base/java.lang=ALL-UNNAMED, per the existing comment in StringEncoderHolder.
  • Both files came from VarHandle string encoder #7701, so the javadoc was inaccurate from the start.

Testing done

  • Docs-only, test-exempt: javadoc only, no behavior, signature, or public API change.
  • ./gradlew :exporters:common:check passed — 66 tests (57 test, 8 testSenderProvider, 1 testWithoutUnsafe), 0 failures.
  • No apidiff update: every class in this module is under io.opentelemetry.exporter.internal.*, which japicmp excludes.
  • No CHANGELOG.md entry: not user-facing.

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.60%. Comparing base (63ebd94) to head (f206f94).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8621      +/-   ##
============================================
- Coverage     91.63%   91.60%   -0.03%     
- Complexity    10326    10343      +17     
============================================
  Files          1013     1013              
  Lines         27295    27352      +57     
  Branches       3205     3215      +10     
============================================
+ Hits          25011    25057      +46     
- Misses         1558     1567       +9     
- Partials        726      728       +2     

☔ 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
thswlsqls marked this pull request as ready for review July 18, 2026 00:50
@thswlsqls
thswlsqls requested a review from a team as a code owner July 18, 2026 00:50
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.

StringEncoder javadoc documents the wrong implementation priority order

1 participant