-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
BigDecimal equals problem #904
Labels
Comments
4 tasks
OmarAlJarrah
added a commit
to OmarAlJarrah/gson
that referenced
this issue
Jul 14, 2022
MaicolAntali
added a commit
to MaicolAntali/gson
that referenced
this issue
Apr 1, 2023
Adds test to check if the equals work with BigDecimals. Code snippet from issue google#904
9 tasks
eamonnmcmanus
pushed a commit
that referenced
this issue
Feb 9, 2024
* Adds support to `BigDecimal` Adds to the JsonPrimitive#equals the possibility to support BigDecimal * Adds test Adds test to check if the equals work with BigDecimals. Code snippet from issue #904 * Implements review comments Replaces the `.equals` method with the `compareTo` in the `JsonPrimitive#equals` Change the ternary operator from `||` to `&&` so we are sure that both are `BigDecimal` Implements tests * Changes to follow the google-style-guide * implements review comment Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com> * Fixes the `OperatorPrecedence` warn * Implements code improvements - Extracts `thisAsDouble` & `otherAsDouble` variables to avoid double functions calls. - Adds a comment to improve the code readability. * Implements `BigDecimal` check in the `JsonPrimitive.equals()` * Formats the code with `spotless:apply` --------- Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
tibor-universe
pushed a commit
to getuniverse/gson
that referenced
this issue
Sep 14, 2024
* Adds support to `BigDecimal` Adds to the JsonPrimitive#equals the possibility to support BigDecimal * Adds test Adds test to check if the equals work with BigDecimals. Code snippet from issue google#904 * Implements review comments Replaces the `.equals` method with the `compareTo` in the `JsonPrimitive#equals` Change the ternary operator from `||` to `&&` so we are sure that both are `BigDecimal` Implements tests * Changes to follow the google-style-guide * implements review comment Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com> * Fixes the `OperatorPrecedence` warn * Implements code improvements - Extracts `thisAsDouble` & `otherAsDouble` variables to avoid double functions calls. - Adds a comment to improve the code readability. * Implements `BigDecimal` check in the `JsonPrimitive.equals()` * Formats the code with `spotless:apply` --------- Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dear developers, it looks like the primitive's equals to did not handle BigDecimal's comparison. The following test will fail:
Could you consider a fix for this, so it can support big decimal comparisons, too?
Thanks!
The text was updated successfully, but these errors were encountered: