Visitar URL original
Return KeyValueAndUnitData from KeyValueAndUnitData.create() by thswlsqls · Pull Request #8875 · open-telemetry/opentelemetry-java · GitHub
Skip to content

Return KeyValueAndUnitData from KeyValueAndUnitData.create() - #8875

Merged
jack-berg merged 1 commit into
open-telemetry:mainfrom
thswlsqls:fix/profiles-key-value-and-unit-create-return-type
Sep 29, 2026
Merged

jack-berg merged 1 commit into
open-telemetry:mainfrom
thswlsqls:fix/profiles-key-value-and-unit-create-return-type

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Fixes #8870

Description

  • KeyValueAndUnitData.create() declared the package-private ImmutableKeyValueAndUnitData as its return type, so KeyValueAndUnitData.create(...).getKeyStringIndex() did not compile outside the data package.
  • It now returns KeyValueAndUnitData, like the other ten *Data.create() factories in the package and as its Javadoc already says.
  • Source-compatible; the binary signature changes, so code compiled against the old jar needs recompiling. opentelemetry-sdk-profiles is alpha (VERSIONING.md) and has no apidiff file.

Testing done

  • Added KeyValueAndUnitDataTest#createResultIsUsableOutsideDataPackage in io.opentelemetry.sdk.profiles. Without the fix, compileTestJava fails with "getKeyStringIndex() is defined in an inaccessible class or interface".
  • ./gradlew :sdk:profiles:check passed (17 tests).
  • ./gradlew :exporters:otlp:profiles:check and :opentelemetry-jfr-profiles-shim:compileJava passed.

create() declared the package-private ImmutableKeyValueAndUnitData as its
return type, so calling a getter directly on the result from another
package did not compile. Return the public interface instead, like the
other *Data.create() factories in the package.
@opentelemetry-pr-dashboard

Copy link
Copy Markdown

Pull request dashboard status

Waiting on the author · refreshed 2026-09-28 09:20 UTC

Move out of draft to request review.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@codecov

codecov Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.33%. Comparing base (ce32c12) to head (d59c27d).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8875   +/-   ##
=========================================
  Coverage     91.33%   91.33%           
- Complexity    10675    10676    +1     
=========================================
  Files          1007     1007           
  Lines         28756    28756           
  Branches       3685     3685           
=========================================
  Hits          26265    26265           
  Misses         1684     1684           
  Partials        807      807           

☔ 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 marked this pull request as ready for review September 29, 2026 19:38
@jack-berg
jack-berg requested a review from a team as a code owner September 29, 2026 19:38
@jack-berg
jack-berg merged commit e380a83 into open-telemetry:main Sep 29, 2026
35 checks passed
@otelbot

otelbot Bot commented Sep 29, 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 fix/profiles-key-value-and-unit-create-return-type branch September 30, 2026 00:27
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.

KeyValueAndUnitData.create() returns a package-private type

2 participants