Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resilience: don't compare Integer objects by refference
Motivation: Though Integer objects are often unboxed for arithmetic operations, a direct equality check of two instances with '==' operator checks only for instance reference level equality. As boxing uses Integer#valueOf, for values below 127 such check can accidentally work. Modification: Use Objects#equals to check equality by value and handle possible 'null' value cases. Result: fix equality check of replica count. Acked-by: Paul Millar Acked-by: Albert Rossi Target: master, 6.0, 5.2, 5.1, 5.0, 4.2 Require-book: no Require-notes: yes
- Loading branch information