Skip to content

Adjust declarative config pojo toString, hashCode, equals to match autovalue#8526

Merged
jack-berg merged 2 commits into
open-telemetry:mainfrom
jack-berg:declarative-config-pojo-generation
Jun 24, 2026
Merged

Adjust declarative config pojo toString, hashCode, equals to match autovalue#8526
jack-berg merged 2 commits into
open-telemetry:mainfrom
jack-berg:declarative-config-pojo-generation

Conversation

@jack-berg

@jack-berg jack-berg commented Jun 23, 2026

Copy link
Copy Markdown
Member

Resolve lingering TODOs from #8408

This has a number of benefits:

  • Generated code is much shorter and more pleasant to read
  • Get to remove a variety of warning suppresions @SuppressWarnings({"NullAway", "rawtypes", "BoxedPrimitiveEquality"})
  • Consistent toString implementation with other value types in this repo. Notably, no inclusion of identity hashcode

To make sure the adjusted equals / hashcode implementations are correct, I've added ModelEqualsHasCodeTest. This uses reflection to detect all the model classes, then uses equalsverifier to assert correctness of equals and has code.

@jack-berg jack-berg requested a review from a team as a code owner June 23, 2026 16:13
@jack-berg jack-berg force-pushed the declarative-config-pojo-generation branch from 21629bf to 8da139e Compare June 23, 2026 16:16
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.63439% with 117 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.94%. Comparing base (6d6bd70) to head (e79dfa3).

Files with missing lines Patch % Lines
...gure/declarativeconfig/model/AggregationModel.java 96.42% 1 Missing ⚠️
...declarativeconfig/model/AlwaysOffSamplerModel.java 87.50% 1 Missing ⚠️
.../declarativeconfig/model/AlwaysOnSamplerModel.java 87.50% 1 Missing ⚠️
.../declarativeconfig/model/AttributeLimitsModel.java 92.85% 1 Missing ⚠️
...clarativeconfig/model/AttributeNameValueModel.java 93.75% 1 Missing ⚠️
...eclarativeconfig/model/B3MultiPropagatorModel.java 87.50% 1 Missing ⚠️
...ure/declarativeconfig/model/B3PropagatorModel.java 87.50% 1 Missing ⚠️
...eclarativeconfig/model/BaggagePropagatorModel.java 87.50% 1 Missing ⚠️
...se2ExponentialBucketHistogramAggregationModel.java 93.75% 1 Missing ⚠️
...tiveconfig/model/BatchLogRecordProcessorModel.java 95.65% 1 Missing ⚠️
... and 107 more
Additional details and impacted files
@@              Coverage Diff              @@
##               main    #8526       +/-   ##
=============================================
+ Coverage     78.51%   90.94%   +12.42%     
- Complexity     8601    10208     +1607     
=============================================
  Files          1013     1013               
  Lines         29150    27166     -1984     
  Branches       3632     3181      -451     
=============================================
+ Hits          22887    24705     +1818     
+ Misses         5420     1734     -3686     
+ Partials        843      727      -116     

☔ 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 77eb68d into open-telemetry:main Jun 24, 2026
45 of 47 checks passed
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