Commit Graph

11 Commits

Author SHA1 Message Date
Maicol 2658aca66a
Fix error prone warnings (#2316)
* Fix `OperatorPrecedence` warn in `JsonWriter#close`

* Fix `ReferenceEquality` warn in `LinkedTreeMap#replaceInParent`

* Fix `UnnecessaryParentheses` warn in `LinkedTreeMap#replaceInParent`

* Fix `ReferenceEquality` warn in `LinkedTreeMap#hasNext`

* Fix `ReferenceEquality` warn in `LinkedTreeMap#nextNode`

* Adds `error_prone_annotations` to the `pom.xml` of `gson`

* Fix `InlineMeSuggester` warns in `JsonParser`

* Fix `UnnecessaryParentheses` warns in `ConstructorConstructor#newDefaultImplementationConstructor`

* Fix `ThreadLocalUsage` warn in `Gson`

* Fix `JdkObsolete` warn in `GsonBuilder`

* Fix `ReferenceEquality` warn in `LazilyParsedNumber#equals`

* Fix `OperatorPrecedence` warn in `TreeTypeAdapter#create`

* Fix `OperatorPrecedence` warn in `ArrayTypeAdapter`

* Fix `UnnecessaryParentheses` warn in `TypeAdapters`

* Adds `-XepExcludedPaths` flag to ErrorProne plugin to exclude tests and proto path

* Fix `ClassNewInstance` warn in `InterceptorAdapter`

* Fix `ThreadLocalUsage` warn in `GraphAdapterBuilder`

* Fix `JdkObsolete` warn in `GraphAdapterBuilder`

* Revert "Adds `error_prone_annotations` to the `pom.xml` of `gson`"

This reverts commit 14af14dfa23b46a54f4855a70ccf2b0a2cdc3e3f.

* Revert "Fix `InlineMeSuggester` warns in `JsonParser`"

This reverts commit 095bfd517e06510e4cc9cc6b1aac58ad9bf3038a.

* Adds `@SuppressWarnings("ThreadLocalUsage")`

* Fix `OperatorPrecedence` in `JsonWriter`

* Revert "Fix `ReferenceEquality` warn in `LinkedTreeMap#nextNode`"

This reverts commit 387746c7f7e3d0943c8f80501f5d9c3710f4862e.

* Adds `@SuppressWarnings("ReferenceEquality")`

* Adds `guava-testlib` to the gson `pom.xml`

* `@SuppressWarnings("TruthSelfEquals")` removed to use `EqualsTester()`
2023-02-15 05:18:43 -08:00
Marcono1234 f7a164d98b
Fail Maven build on compiler warnings; remove some warning suppressions (#2183)
* Fail Maven build on compiler warnings; remove some warning suppressions

* Fix compiler warnings causing failure for newer JDK

* Improve placement of "raw" and "unchecked" warning suppressions

* Adjust javac documentation link

* Fix compilation error on newer JDKs
2022-08-26 17:36:18 -07:00
Marcono1234 e6fae590cf
Prevent Java deserialization of internal classes (#1991)
Adversaries might be able to forge data which can be abused for DoS attacks.
These classes are already writing a replacement JDK object during serialization
for a long time, so this change should not cause any issues.
2021-10-13 10:14:57 -07:00
Inderjeet Singh 96b2ada79a incorporated code review feedback: optimized LazilyParsedNumber.equals/hashcode() by utilizing the fact that value is never passed as null. 2015-09-27 13:58:01 -07:00
Inderjeet Singh 3aec173243 small reformatting 2015-09-26 18:02:12 -07:00
Inderjeet Singh 3daf585931 Implemented equals and hashcode for LazilyParsedNumber to fix
https://github.com/google/gson/issues/627
2015-09-26 17:58:13 -07:00
Joel Leitch 3f4bc4cd10 Remove unused import 2013-05-13 20:38:35 +00:00
Joel Leitch e4508227c5 Added test to use BigDecimal to parse number when requesting it as a long. 2013-05-13 20:37:33 +00:00
Inderjeet Singh 26016ca66e removed eclipse warnings, unused fields. Made inner classes static where possible. 2013-04-12 20:09:08 +00:00
Jesse Wilson 1a4f690335 Regretfully enable serialization for StringMap and LazilyParsedNumber.
One of our favorite users (my employer!) is stuck in a sad situation where they need to serialize objects returned from Gson; this is a workable escape hatch.
2012-08-15 14:58:26 +00:00
Inderjeet Singh d70fb90ef7 Added methods to convert to JsonElement in TypeAdapter.
Using lenient mode while working with Gson.
Handling nulls while invoking legacy Gson type adapters.
2011-08-03 02:40:18 +00:00