Skip to content

Merge CollectionUndefinedEquality and ArrayAsKeyOfSetOrMap into UndefinedEquals. - #6205

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_997801100
Oct 13, 2026
Merged

copybara-service[bot] merged 1 commit into
masterfrom
test_997801100

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

Merge CollectionUndefinedEquality and ArrayAsKeyOfSetOrMap into UndefinedEquals.

UndefinedEquals, CollectionUndefinedEquality, and ArrayAsKeyOfSetOrMap all report code that relies on equals or hashCode of types where those methods aren't meaningful, but each covered a different subset of use sites: direct equality, collection containment, and hash-based container creation.

Add AbstractEqualsHashCodeUsageChecker, which finds the places where code relies on equals and hashCode, either explicitly or implicitly through collections, and lets each check decide which types are a problem for each kind of use. Rebuild UndefinedEquals on top of it, absorbing the other two checks and keeping their names as altNames so existing suppressions and -Xep flags keep working.

…inedEquals.

`UndefinedEquals`, `CollectionUndefinedEquality`, and `ArrayAsKeyOfSetOrMap` all report code that relies on `equals` or `hashCode` of types where those methods aren't meaningful, but each covered a different subset of use sites: direct equality, collection containment, and hash-based container creation.

Add `AbstractEqualsHashCodeUsageChecker`, which finds the places where code relies on `equals` and `hashCode`, either explicitly or implicitly through collections, and lets each check decide which types are a problem for each kind of use. Rebuild `UndefinedEquals` on top of it, absorbing the other two checks and keeping their names as `altNames` so existing suppressions and `-Xep` flags keep working.

PiperOrigin-RevId: 998967393
@copybara-service
copybara-service Bot merged commit b8a8390 into master Oct 13, 2026
8 checks passed
@copybara-service
copybara-service Bot deleted the test_997801100 branch October 13, 2026 23:34
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.

1 participant