chore(tracing-otel): inline HeadersTextMap{Getter,Setter} into OtelTracer#198
Merged
Merged
Conversation
…acer Both adapters were package-private SPI helpers with exactly one production callsite (OtelTracer itself), zero tests, zero examples. Their Javadoc already declared them as "Used by OtelTracer#..." — conceptually private. Pulling them into OtelTracer as private static nested final classes (preserving the stateless-singleton INSTANCE shape) drops two top-level files, keeps the TextMapGetter/Setter SPI shape intact, and tightens encapsulation: the adapters now cannot be referenced from anywhere else in the module. Net LOC: -61 / +53 = -8 lines, one less compilation unit. JPMS unchanged: package-info still exports the same package; the deleted classes were never independently exported, so no module-info edit needed.
Owner
Author
|
@copilot please review |
Copilot stopped work on behalf of
eschizoid due to an error
June 19, 2026 17:54
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #198 +/- ##
=========================================
Coverage 77.82% 77.82%
+ Complexity 732 727 -5
=========================================
Files 68 66 -2
Lines 2800 2800
Branches 346 348 +2
=========================================
Hits 2179 2179
Misses 462 462
Partials 159 159 ☔ View full report in Codecov by Harness. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HeadersTextMapGetterandHeadersTextMapSetterwere package-private SPI adapters with exactly one production callsite (OtelTraceritself), zero tests, zero examples. Their Javadoc already declared them as "Used byOtelTracer#..." — conceptually private helpers leaking out as top-level types.private static final classnested insideOtelTracer(kept as parallel nested classes rather than mixing a lambda for the setter and a class for the getter —TextMapGetterhas two methods so it can't be a lambda anyway, and the symmetric shape reads better).INSTANCEsemantics from the originals; callsites were updated fromHeadersTextMapGetter.INSTANCE/HeadersTextMapSetter.INSTANCEto the nestedHeadersGetter.INSTANCE/HeadersSetter.INSTANCE.[HeadersTextMapSetter] / [HeadersTextMapGetter]bullet frompackage-info.javaand folded the propagation note into theOtelTracerbullet.Cohesion win
OtelTracer— they cannot be referenced from anywhere else in the module, which matches their actual usage. One fewer top-level surface forkpipe-tracing-otelto defend.TextMapGetter/TextMapSetter/Header/ArrayList/StandardCharsetsinOtelTracer.JPMS
module-info.javaonlyexports io.github.eschizoid.kpipe.tracing.otel;(whole package). The deleted classes were package-private, so they were never independently visible. No module-info edit needed.Test plan
./gradlew :lib:kpipe-tracing-otel:test→ BUILD SUCCESSFULgrep -rn 'HeadersTextMapGetter\|HeadersTextMapSetter' lib/ examples/ benchmarks/ --include='*.java' --include='*.kt'returns no hits