[dynamic control] remove policy equals/hashcode as they are no longer needed#2968
Merged
Merged
Conversation
25 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Removes now-unneeded value-based equals/hashCode overrides from dynamic-control telemetry policy implementations after the policy store comparison model changed (per #2960), and updates documentation/tests accordingly.
Changes:
- Dropped
equals/hashCodeoverrides fromTraceSamplingRatePolicyandDeletedTelemetryPolicy. - Removed tests and test-helper overrides that asserted value-based Java equality.
- Updated
TelemetryPolicydocumentation and a comment in probability normalization to reflect the new comparison behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/tracesampling/TraceSamplingRatePolicy.java | Removes equality/hash behavior and adjusts normalization comment wording. |
| dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/DeletedTelemetryPolicy.java | Removes equality/hash behavior for deleted policy marker instances. |
| dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/TelemetryPolicy.java | Updates interface docs to emphasize store identity is not based on Java object equality. |
| dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/tracesampling/TraceSamplingRatePolicyTest.java | Removes equality/hash tests and keeps probability normalization coverage. |
| dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/DeletedTelemetryPolicyTest.java | Removes equality/hash tests for deleted policies. |
| dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/LinePerPolicyFileProviderTest.java | Removes unnecessary equality/hash overrides from a test policy helper. |
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
LikeTheSalad
approved these changes
Jul 8, 2026
jaydeluca
approved these changes
Jul 8, 2026
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.
Description:
#2960 changed how policies are compared, following which they no longer need to adapt equals/hashcode, so those method overrides are being dropped
Existing Issue(s):
#2868
Testing:
added
Documentation:
n/a
Outstanding items:
#2868