-
Notifications
You must be signed in to change notification settings - Fork 747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggest Double.compare in ObjectEqualsForPrimitives #4394
Conversation
We have some internal guidance to use I'm also wondering if we should exclude |
f5bc7db
to
037b589
Compare
@cushon thank you for your review!
Would you mind triggering the build again?
i am not sure i understand. Can you please rephrase? |
I was wondering about having ObjectEqualsForPrimitives not emit findings for |
Sure, I can do that. |
`Objects.equal(a_double, another_double)` and `a_double == another_double` have different semantics (different result when both compared values are NaN). Suggest replacement using `Double.compare` to avoid changing code semantics. This is especially relevant when implementing `equals` methods.
037b589
to
603b9c6
Compare
@cushon Would you mind triggering the build again? |
@cushon thanks for approval. |
JDK EA is also failing at head, there are some breaking changes we'll need to prepare for before JDK 23 is released, but it doesn't need to be a blocker for this |
`Objects.equal(a_double, another_double)` and `a_double == another_double` have different semantics (different result when both compared values are NaN). This is especially relevant when implementing `equals` methods. Fixes #4392 Fixes #4394 FUTURE_COPYBARA_INTEGRATE_REVIEW=#4394 from findepi:findepi/double-compare 603b9c6 PiperOrigin-RevId: 634390506
thanks for the merge! |
oh, and thanks for fixing the commit message. |
sure thing!
@cpovirk gets the credit for that part :) |
Objects.equal(a_double, another_double)
anda_double == another_double
have different semantics (different result when both compared values are NaN). Suggest replacement usingDouble.compare
to avoid changing code semantics. This is especially relevant when implementingequals
methods.Fixes #4392