Skip to content

Fix SpanLimitsBuilder Javadoc to match non-negative argument check#8516

Draft
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:docs/fix-spanlimits-builder-javadoc-non-negative
Draft

Fix SpanLimitsBuilder Javadoc to match non-negative argument check#8516
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:docs/fix-spanlimits-builder-javadoc-non-negative

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Fixes #8515

Description

  • SpanLimitsBuilder's five count setters documented @param ... Must be positive. and @throws IllegalArgumentException if {@code ...} is not positive., but each checks value >= 0 ("must be non-negative") and accepts 0.
  • Corrected the Javadoc to "Must not be negative." / "is negative." for setMaxNumberOfAttributes, setMaxNumberOfEvents, setMaxNumberOfLinks, setMaxNumberOfAttributesPerEvent, and setMaxNumberOfAttributesPerLink.
  • This matches the sixth setter setMaxAttributeValueLength, which already documents the same >= 0 check correctly.
  • The >= 0 behavior is intentional: PR Follow spec on span limits, batch processors #7030 relaxed these checks to follow the spec but left this Javadoc stale.

Testing done

  • Docs-only, test-exempt: no behavior, signature, or public API change, so no test added.
  • ./gradlew :sdk:trace:check passed (155 actionable tasks; test + spotlessCheck + ErrorProne/NullAway + jApiCmp). No docs/apidiffs change (Javadoc only). No CHANGELOG entry (not user-facing).

@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8516      +/-   ##
============================================
- Coverage     78.77%   78.76%   -0.01%     
+ Complexity     8579     8578       -1     
============================================
  Files          1009     1009              
  Lines         28993    28993              
  Branches       3599     3599              
============================================
- Hits          22839    22837       -2     
- Misses         5311     5312       +1     
- Partials        843      844       +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.

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.

SpanLimitsBuilder Javadoc states setters must be positive but they accept zero

1 participant