gson-comments/gson/src/main/java/com/google/gson
Maicol db61bb07f0
Adds support to `BigDecimal` in `JsonPrimitive#equals` (#2364)
* 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>
2024-02-09 08:38:42 -08:00
..
annotations Formats codebase (#2531) 2023-11-06 11:59:01 -08:00
internal Fix $Gson$Types equals method for TypeVariable when its generic declaration is not a Class (#2599) 2024-01-30 14:29:07 -08:00
reflect Perform minor code clean-up (#2544) 2023-11-19 09:01:19 -08:00
stream Enable additional Error Prone checks & fix violations (#2561) 2024-01-09 10:19:09 -08:00
ExclusionStrategy.java Formats codebase (#2531) 2023-11-06 11:59:01 -08:00
FieldAttributes.java Formats codebase (#2531) 2023-11-06 11:59:01 -08:00
FieldNamingPolicy.java Formats codebase (#2531) 2023-11-06 11:59:01 -08:00
FieldNamingStrategy.java Formats codebase (#2531) 2023-11-06 11:59:01 -08:00
FormattingStyle.java Formats codebase (#2531) 2023-11-06 11:59:01 -08:00
Gson.java Enable additional Error Prone checks & fix violations (#2561) 2024-01-09 10:19:09 -08:00
GsonBuilder.java Enable additional Error Prone checks & fix violations (#2561) 2024-01-09 10:19:09 -08:00
InstanceCreator.java Formats codebase (#2531) 2023-11-06 11:59:01 -08:00
JsonArray.java Formatting follow-up (#2540) 2023-11-14 15:09:54 -08:00
JsonDeserializationContext.java Formats codebase (#2531) 2023-11-06 11:59:01 -08:00
JsonDeserializer.java Formats codebase (#2531) 2023-11-06 11:59:01 -08:00
JsonElement.java Formats codebase (#2531) 2023-11-06 11:59:01 -08:00
JsonIOException.java Formats codebase (#2531) 2023-11-06 11:59:01 -08:00
JsonNull.java Updates the line separator from `CRLF` to `LF` (#2536) 2023-11-10 12:36:42 -08:00
JsonObject.java Formats codebase (#2531) 2023-11-06 11:59:01 -08:00
JsonParseException.java Formats codebase (#2531) 2023-11-06 11:59:01 -08:00
JsonParser.java Updates the line separator from `CRLF` to `LF` (#2536) 2023-11-10 12:36:42 -08:00
JsonPrimitive.java Adds support to `BigDecimal` in `JsonPrimitive#equals` (#2364) 2024-02-09 08:38:42 -08:00
JsonSerializationContext.java Formats codebase (#2531) 2023-11-06 11:59:01 -08:00
JsonSerializer.java Formats codebase (#2531) 2023-11-06 11:59:01 -08:00
JsonStreamParser.java Formats codebase (#2531) 2023-11-06 11:59:01 -08:00
JsonSyntaxException.java Formats codebase (#2531) 2023-11-06 11:59:01 -08:00
LongSerializationPolicy.java Formats codebase (#2531) 2023-11-06 11:59:01 -08:00
ReflectionAccessFilter.java Perform minor code clean-up (#2544) 2023-11-19 09:01:19 -08:00
Strictness.java Formats codebase (#2531) 2023-11-06 11:59:01 -08:00
ToNumberPolicy.java Formats codebase (#2531) 2023-11-06 11:59:01 -08:00
ToNumberStrategy.java Formats codebase (#2531) 2023-11-06 11:59:01 -08:00
TypeAdapter.java Enable additional Error Prone checks & fix violations (#2561) 2024-01-09 10:19:09 -08:00
TypeAdapterFactory.java Formats codebase (#2531) 2023-11-06 11:59:01 -08:00
package-info.java Formats codebase (#2531) 2023-11-06 11:59:01 -08:00