Skip to content

Handle negation in ObjectEqualsForPrimitives. - #6065

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_967399846
Aug 25, 2026
Merged

Handle negation in ObjectEqualsForPrimitives.#6065
copybara-service[bot] merged 1 commit into
masterfrom
test_967399846

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

Handle negation in ObjectEqualsForPrimitives.

When converting !Objects.equals(a, b) to use primitive equality, rewriting only the method call leaves an awkward !(a == b). Inspect parent AST nodes across enclosing parentheses to detect logical negation (!) and replace the whole expression with (a != b).

When converting `!Objects.equals(a, b)` to use primitive equality, rewriting only the method call leaves an awkward `!(a == b)`. Inspect parent AST nodes across enclosing parentheses to detect logical negation (`!`) and replace the whole expression with `(a != b)`.

PiperOrigin-RevId: 970828962
@copybara-service
copybara-service Bot merged commit 19ed7ca into master Aug 25, 2026
1 check passed
@copybara-service
copybara-service Bot deleted the test_967399846 branch August 25, 2026 22:18
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