Commit Graph

9 Commits

Author SHA1 Message Date
Éamonn McManus
c1da2d7070
Add @CanIgnoreReturnValue as appropriate to Gson methods. (#2369)
This annotation indicates that return value of the annotated method does
not need to be used. If it is _not_ present on a non-void method, and if
Error Prone's `CheckReturnValue` is active, then calling the method
without using the result is an error. However, we are not enabling
`CheckReturnValue` by default here.

Also update some code that does ignore return values, so that the
returned value is used, if only by assigning it to an unused variable.
2023-04-10 10:50:25 -07:00
Maicol
49b00d1a86
Port all Junit assert to Truth asserts (#2304)
* Port Junit assert to Truth in `com.google.gson.stream`

* Port Junit assert to Truth in `com.google.gson.regression`

* Port Junit assert to Truth in `om.google.gson.reflect`

* Port Junit assert to Truth in `com.google.gson.metrics`

* Port Junit assert to Truth in `com.google.gson.internal`

* Port Junit assert to Truth in `com.google.gson.internal.sql`

* Port Junit assert to Truth in `com.google.gson.internal.reflect`

* Port Junit assert to Truth in `com.google.gson.internal.bind`

* Port Junit assert to Truth in `com.google.gson.internal.bind.util`

* Port Junit assert to Truth in `com.google.gson.functional`

* Replaces `List.of` with `Arrays.asList` to grant legacy

* Simplify `==` asserts

* Simplify `.contain()` asserts + Minor fixes

* Simplify asserts
2023-01-31 11:20:54 -08:00
Maicol
1a2170b99c
Port tests from JUnit 3 to JUnit 4 (#2294)
* Port tests from JUnit 3 to JUnit 4

* Port tests from JUnit 3 to JUnit 4

* Add `@Test` above `@Ignore`
2022-12-22 06:04:16 -08:00
Marcono1234
4dda4ec5ba
Use diamond operator when creating generic instances (#2104) 2022-04-17 15:27:21 -07:00
Degubi
7845c38077 Minor cleanups in deprecations and other warnings (#1522) 2019-10-03 15:49:24 -07:00
Inderjeet Singh
1ab73ffd21 incorporated code review feedback by eliminating the stringified type adapter. 2016-02-26 09:25:23 -08:00
Inderjeet Singh
1fa43821e8 removed unneeded null check. 2016-02-25 19:37:07 -08:00
Inderjeet Singh
79a00cd906 incorporated code review feedback. Simplified the code, merged Device and Control and removed unnecessary fields. 2016-02-25 17:38:48 -08:00
Inderjeet Singh
c731abb293 Fixed a regression in Gson 2.6 where Gson caused NPE if the TypeAdapterFactory.create() returned null. 2016-02-25 13:56:42 -08:00