Commit Graph

705 Commits

Author SHA1 Message Date
Marcono1234
6fc1c8f7f1
Fix TypeAdapter.toJson throwing AssertionError for custom IOException (#2172)
* Fix TypeAdapter.toJson throwing AssertionError for custom IOException

* Add throws javadoc tag for TypeAdapter methods
2022-08-08 08:19:44 -07:00
Marcono1234
a4bc6c17d7
Fix JsonTreeReader throwing wrong exception type for non-finite doubles (#1782)
Follow-up for #1767
2022-08-08 06:39:29 -07:00
Marcono1234
9eb04414c0
Improve InternationalizationTest (#1705)
* Improve InternationalizationTest

- Remove "raw" tests since after compiling they are the same as the one with
  escape sequences
- Add tests for supplementary code points (> \uFFFF)

* Improve variable names, fix incorrect escape sequences
2022-08-07 16:00:35 -07:00
Marcono1234
246270e02c
Convert null to JsonNull for JsonArray.set (#2170)
* Convert null to JsonNull for `JsonArray.set`

All other methods perform the same implicit conversion.

* Mention null handling in JsonObject documentation
2022-08-06 09:57:00 -07:00
bufistov
46b97bf156
Fixed nullSafe usage. (#1555)
The JsonSerializer/Deserializer adapters used to ignore this attribute
which result in inconsistent behaviour for annotated adapters.

Fixes #1553

Signed-off-by: Dmitry Bufistov <dmitry@midokura.com>

Co-authored-by: Dmitry Bufistov <dmitry@midokura.com>
2022-08-05 07:33:05 -07:00
Marcono1234
98f2bbf4c1
Validate TypeToken.getParameterized arguments (#2166) 2022-08-05 06:59:38 -07:00
Marcono1234
0b6a7bf7d9
Deprecate JsonElement constructor (#1761)
* Deprecate JsonElement constructor

Creating custom JsonElement subclasses is discouraged.

* Improve test and documentation

* Improve JsonTreeReaderTest, adjust deprecation comments
2022-08-04 10:32:30 -07:00
Marcono1234
a1d2ebc8b5
Fix #1702: Gson.toJson creates CharSequence which does not implement toString (#1703)
* Gson.toJson creates CharSequence which does not implement toString

* Improve Streams.AppendableWriter.CurrentWrite test

* Make setChars package-private
2022-08-03 14:25:12 -07:00
Marcono1234
4552db2630
Prefer existing adapter for concurrent Gson.getAdapter calls (#2153)
Additionally fail fast for null as type (previous null support was broken
and would have thrown NullPointerException further below anyways).
2022-08-01 10:59:04 -07:00
Marcono1234
a45c55739f
Improve ArrayTypeAdapter for Object[] (#1716)
* Improve ArrayTypeAdapter for Object[]

* Fix typo in test method names
2022-07-31 14:49:02 -07:00
Marcono1234
5f2513a407
Improve AppendableWriter performance (#1706)
* Improve AppendableWriter performance

Override methods which by default create char arrays or convert
CharSequences to Strings.
This is not necessary for AppendableWriter because it can directly
append these values to the Appendable delegate.

* Add test for Streams.writerForAppendable
2022-07-31 14:46:43 -07:00
Marcono1234
6d2557d5d1
Remove unused package-private FieldAttributes methods (#2162) 2022-07-29 10:10:54 -07:00
Marcono1234
cbc0af867b
Improve lenient mode documentation (#2122) 2022-06-28 09:48:05 -07:00
Marcono1234
2d01d6a20f
Make Object and JsonElement deserialization iterative (#1912)
* Make Object and JsonElement deserialization iterative

Often when Object and JsonElement are deserialized the format of the JSON
data is unknown and it might come from an untrusted source. To avoid a
StackOverflowError from maliciously crafted JSON, deserialize Object and
JsonElement iteratively instead of recursively.

Concept based on 51fd2faab7
But implementation is not based on it.

* Improve imports grouping

* Address review feedback
2022-06-22 17:42:19 -07:00
Nathan Herring
d2aee6502b
Add explicit support for floats in JsonTreeWriter. (#2132)
Follow-up to comments on #2130, which introduced a new override which was not overridden by `JsonTreeWriter`. Also tweaks the doccomments for `float`, `double` and `Number` variants of `JsonWriter.value`.

Supplement to the fix for #1127.
2022-06-21 09:50:07 -07:00
Marcono1234
57225c6741
Fail when parsing invalid local date (#2134)
* Fail when parsing invalid local date

* Improve invalid date tests
2022-06-16 13:47:57 -07:00
Nathan Herring
96ab171eb4
Add explicit support for floats in JsonWriter. (#2130)
This avoids floats being treated as doubles and having an unwarranted level of precision.

Fixes #1127.
2022-06-08 15:04:42 -07:00
379b2563b2
Use deferred comment serialization to fix prominent issues 2022-06-04 11:59:48 +02:00
031f729d32
Fix Json5 test 2022-05-17 21:40:18 +02:00
dc4e61ac7b
Several breaking changes 2022-05-17 21:20:10 +02:00
35241fc7b2
Add comment support 2022-05-12 23:23:14 +02:00
9d7fd891ee
Merge branch 'allow_duplicate_map_key'
# Conflicts:
#	gson/src/main/java/com/google/gson/GsonBuilder.java
#	gson/src/test/java/com/google/gson/GsonTest.java
2022-05-12 22:54:17 +02:00
Marcono1234
b1c399fd62
Improve TypeToken creation validation (#2072)
* Add comments regarding multiple bounds of wildcard

* Remove WildcardType check in getCollectionElementType

The returned Type is never a wildcard due to the changes made to getSupertype
by commit b1fb9ca9a1.

* Remove redundant getRawType call from MapTypeAdapterFactory

getRawType(TypeToken.getType()) is the same as calling TypeToken.getRawType().

* Make TypeToken members private

* Remove incorrect statement about TypeToken wildcards

It is possible to use wildcards as part of the type argument, e.g.:
`new TypeToken<List<? extends CharSequence>>() {}`

* Only allow direct subclasses of TypeToken

Previously subclasses of subclasses (...) of TypeToken were allowed which
can behave incorrectly when retrieving the type argument, e.g.:

  class SubTypeToken<T> extends TypeToken<Integer> {}
  new SubTypeToken<String>() {}.getType()

This returned `String` despite the class extending TypeToken<Integer>.

* Throw exception when TypeToken captures type variable

Due to type erasure the runtime type argument for a type variable is not
available. Therefore there is no point in capturing a type variable and it
might even give a false sense of type-safety.

* Make $Gson$Types members private

* Rename $Gson$Types.getGenericSupertype parameter

Rename the method parameter to match the documentation of the method and
to be similar to getSupertype(...).

* Improve tests and handle raw TypeToken supertype better

* Make some $Gson$Types members package-private again to prevent synthetic accessors

* Remove TypeToken check for type variable

As mentioned in review comments, there are cases during serialization where
usage of the type variable is not so problematic (but still not ideal).
2022-04-19 08:20:58 -07:00
Marcono1234
4dda4ec5ba
Use diamond operator when creating generic instances (#2104) 2022-04-17 15:27:21 -07:00
Marcono1234
e82637c485
Add support for reflection access filter (#1905)
* Add support for reflection access filter

* Improve documentation

* Fix compilation errors

* Relax handling for BLOCK_ALL when invoking default constructor

* Improve handling for inherited fields

* Fix accessible test failing for static fields

* Simplify ReflectiveTypeAdapterFactory field writing

* Fix GsonBuilder changes affecting created Gson instances

* Improve documentation

* Improve handling for IllegalAccessException

For Java < 9, AccessibleObject.canAccess is not available and therefore checks
might pass even if object is not accessible, causing IllegalAccessException
later.

* Fix incorrect GsonBuilder.addReflectionAccessFilter documentation
2022-04-17 09:05:18 -07:00
Marcono1234
b5343ba96c
Add tests for enum constant toString() reading (#2080) 2022-02-21 14:53:59 -08:00
Marcono1234
49ddab9eeb
Add CodeQL GitHub code scanning workflow (#2076)
* Add CodeQL GitHub code scanning workflow

* Only compile main sources for code scanning

* Move test .proto  files to test sources

`annotations.proto` also seems to be only relevant for tests because the test
explicitly registers them as extensions. By default the Proto adapter does not
consider them.

* Address some code scanning findings

* Fix some more findings
2022-02-17 18:40:40 -08:00
Marcono1234
47dea2eefc
Improve error message when abstract class cannot be constructed (#1814) 2022-02-04 14:19:47 -08:00
Marcono1234
565b7a198e
Support EnumMap deserialization (#2071) 2022-02-04 07:20:32 -08:00
Marcono1234
e2e851c9bc
Add LazilyParsedNumber default adapter (#2060)
* Add LazilyParsedNumber default adapter

* Validate JsonWriter.value(Number) argument

* Fix incorrect JSON number pattern, extend tests
2022-01-28 11:26:28 -08:00
Marcono1234
710a76c8b8
Fix JsonReader.hasNext() returning true at end of document (#2061) 2022-01-27 15:59:50 -08:00
Éamonn McManus
26e08fe742
Fix a mistaken use of StringBuilder('#'). (#2052) 2022-01-12 08:58:30 -08:00
Marcono1234
d38e397421
Fix ObjectTest not restoring default Locale (#2050) 2022-01-10 07:18:42 -08:00
Marcono1234
6b96a389cc
Put module-info.class into Multi-Release JAR folder (#2013)
* Put module-info.class into Multi-Release JAR folder

Uses ModiTect to place module-info.class under Multi-Release JAR folder
`META-INF/versions/9`.

* Adjust pom.xml to drop support for Java 6

* Change doclint setting

All Javadoc errors have been solved previously; doclint can now be enabled
without causing build failures.

* Improve README Java requirements
2022-01-01 12:44:39 -08:00
Marcono1234
dc28951fa7
Change target Java version to 7 (#2043)
* Change target Java version to 7

* Document Gson requirements

* Add package-info.java for `stream` package
2021-12-31 07:20:29 -08:00
Marcono1234
615c8835d3
Add GsonBuilder.disableJdkUnsafe() (#1904)
* Add GsonBuilder.disableJdkUnsafe()

* Address review feedback
2021-12-30 15:08:18 -08:00
yixingz3
eaf9a0342d
feat: added UPPER_CASE_WITH_UNDERSCORES in FieldNamingPolicy (#2024) 2021-11-28 09:33:22 -08:00
Éamonn McManus
6e06bf0d89 Fix for an ArrayIndexOutOfBoundsException.
The `fillBuffer` method changes `pos`, so it is incorrect to cache
its previous value.
2021-11-11 14:12:44 -05:00
Marcono1234
b0595c595b
Fix failing to serialize Collection or Map with inaccessible constructor (#1902)
* Remove UnsafeReflectionAccessor

Revert #1218

Usage of sun.misc.Unsafe to change internal AccessibleObject.override field
to suppress JPMS warnings goes against the intentions of the JPMS and does not
work anymore in newer versions, see #1540.
Therefore remove it and instead create a descriptive exception when making a
member accessible fails. If necessary users can also still use `java` command
line flags to open external modules.

* Fix failing to serialize Collection or Map with inaccessible constructor

Also remove tests which rely on Java implementation details.

* Don't keep reference to access exception of ConstructorConstructor

This also avoids a confusing stack trace, since the previously caught
exception might have had a complete unrelated stack trace.

* Remove Maven toolchain requirement

* Address review feedback

* Add back test for Security Manager
2021-11-09 07:16:35 -08:00
Marcono1234
ca2ed748ba
Fix warnings (#2014)
* Fix warnings

* Address review feedback
2021-11-07 08:43:49 -08:00
Marcono1234
deaa3a6cd9
Fix Gson.newJsonWriter ignoring lenient and HTML-safe setting (#1989)
* Improve Gson newJsonWriter and newJsonReader documentation

* Consider lenient and HTML-safe setting for Gson.newJsonWriter

* Remove empty line between imports
2021-11-01 15:11:10 -07:00
Marcono1234
e0de45ff69
Delete unused LinkedHashTreeMap (#1992)
Class seems to be unused since commit f29d5bc37b.
Gson currently only uses LinkedTreeMap.
2021-11-01 15:09:14 -07:00
Marcono1234
b4dab86b10
Make default adapters stricter; improve exception messages (#2000)
* Make default adapters stricter; improve exception messages

* Reduce scope of synchronized blocks

* Improve JsonReader.getPath / getPreviousPath Javadoc
2021-11-01 15:08:04 -07:00
Marcono1234
b3188c1132
Fix FieldNamingPolicy.upperCaseFirstLetter uppercasing non-letter (#2004) 2021-11-01 15:05:04 -07:00
Jaroslav Tulach
ca1df7f7e0
#1981: Optional OSGi bundle's dependency on sun.misc package (#1993)
* #1981: Avoid OSGi bundle's dependency on sun.misc package

* Specify optional dependency on sun.misc.Unsafe

* Adjusting the test to sun.misc import being optional

* Using Collections.list and for loop

* Let the fail message include name of package

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>

* Closing the input stream

* Dedicated assertSubstring method

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
2021-10-25 11:32:10 -07:00
Marcono1234
c54caf308c
Deprecate Gson.excluder() exposing internal Excluder class (#1986) 2021-10-25 11:28:16 -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
Marcono1234
bda2e3d16a
Improve number strategy implementation (#1987)
* Fix GsonBuilder not copying number strategies from Gson

* Improve ToNumberPolicy exception messages
2021-10-11 16:14:47 -07:00
Marcono1234
cd748df712
Fix LongSerializationPolicy null handling being inconsistent with Gson (#1990)
Gson does not actually use the specified LongSerializationPolicy but instead
uses type adapters which emulate the behavior. However, previously Gson's
implementation did not match LongSerializationPolicy regarding null handling.

Because it is rather unlikely that LongSerializationPolicy has been used on
its own, this commit adjusts its implementation to match Gson's behavior
(instead of the other way around).
2021-10-11 12:34:32 -07:00
Lyubomyr Shaydariv
fe30b85224
Support arbitrary Number implementation for Object and Number deserialization (#1290)
* Object and Number type adapters number deserialization can be configured

* Change wording of ToNumberStrategy documentation

* Use inline links in doc sparingly

If the element has already been linked before, don't create a link for
every subsequent occurrence.

See also (slightly dated)
https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html#inlinelinks

* Link to default to-number policies in ToNumberStrategy doc

* Reduce code duplication for deserializing Number

* Hide default factory constants of NumberTypeAdapter and ObjectTypeAdapter

This encapsulates the logic a little bit better.
Additionally refactored factory created by NumberTypeAdapter to only create
TypeAdapter once and then have factory reuse that adapter for better
performance.

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
2021-10-08 17:09:43 -07:00
Éamonn McManus
c8f26dc907
Add missing calls when testing for exceptions. (#1948) 2021-08-31 15:03:45 -07:00
Éamonn McManus
1a2e58a42f
Remove an unused import. (#1947) 2021-08-31 14:55:07 -07:00
Simon Guerout
ac14b4c197 Make the nextJsonElement more robust
Add test cases
2021-08-30 09:57:08 -07:00
Éamonn McManus
69173b02ea
Merge branch 'master' into optional-sql 2021-08-24 13:41:12 -07:00
Éamonn McManus
9edaeb3b2e
Merge pull request #1909 from HiFromAjay/aj
Test cases for testing the exceptional behavior of JsonArray get... methods
2021-08-07 07:54:12 -07:00
HiFromAjay
01ab13f701 Remove unused imports [#1909, #1908] 2021-08-05 17:23:28 -06:00
YOUNG HO CHA
d8c5fcf00b Fix indentation of EnumWithObfuscatedTest 2021-08-04 12:30:07 +09:00
YOUNG HO CHA
92a98dab02 Removed unused import 2021-08-04 12:03:15 +09:00
YOUNG CHA
94f894cf44 Add testcase for obfuscated enum class 2021-08-04 12:02:50 +09:00
Éamonn McManus
63e747f7f4
Merge pull request #1712 from rhernandez35/master
Fix fallback behavior of UnsafeReflectionAllocator when AccessibleObject isn't so accessible
2021-08-03 17:27:54 -07:00
Éamonn McManus
425cb25549 Adjust some minor details of #1391.
Use two-space indentation for the new test.
Use standard Google import style.
Supply missing type argument for `TypeVariable`.
2021-08-02 17:33:10 -07:00
Éamonn McManus
d65960b001
Merge pull request #1391 from mcumings/issue1390
Fix issue with recursive type variable protections to fix #1390
2021-08-02 16:43:19 -07:00
HiFromAjay
2d1981d39b modify test cases for testing the exceptional behavior of get... methods [use fail(...), use JsonArray methods, remove unused values, formatting, #1909, #1908] 2021-06-14 14:31:14 -06:00
HiFromAjay
55115a5ca2 Test cases for testing the exceptional behavior of get, getAsBoolean, getAsDouble, getAsInt, getAsJsonArray, getAsJsonObject, getAsLong, and getAsString methods of JsonArray class. These test cases, which we wrote according to the specified behavior of each method, that helped us in identifying the documentation bugs in JsonArray and JsonElement classes, which we submitted issues for (Issue #1908). Note that we have adapted these test cases based on similar tests from the JSON-java project (https://github.com/stleary/JSON-java). 2021-06-11 10:04:32 -06:00
tiegen
e6b7da988a
Update gson/src/test/java/com/google/gson/GsonTest.java
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
2021-04-25 16:34:26 +08:00
tiegen
8990169194
Update gson/src/test/java/com/google/gson/GsonTest.java
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
2021-04-25 16:34:18 +08:00
saddays
a0ea108c59 allow deserialize duplicate map key 2021-04-21 14:39:45 +08:00
Richard Hernandez
b39494dbe6 Fix fallback behavior of UnsafeReflectionAllocator when AccessibleObject isn't so accessible 2020-05-26 20:12:36 -07:00
Marcono1234
4fb215c9df Move SQL types specific tests to separate test class 2020-05-23 23:31:03 +02:00
Marcono1234
380c4ec12c Make dependency on java.sql optional 2020-05-23 23:30:53 +02:00
Marcono1234
361292f1c1 Fix warnings 2020-05-09 17:34:53 +02:00
Marcono1234
541252a9fb Implement DefaultDateTypeAdapter in a type safer way 2020-05-09 17:34:52 +02:00
Marcono1234
9171715a88 Fix ISO8601UtilsTest failing on systems with UTC+X
Previously ISO8601UtilsTest.testDateFormatString() would fail on systems
where the time zone is UTC+X because getTime() returned "2018-06-24" for them.

Additionally the tests which previously changed the system locale and time
zone have been rewritten to create a UTC calendar instead. Setting locale
seems to not be necessary because ISO8601Utils.parse(...) does not do that
either.
2020-05-03 00:35:47 +02:00
Jiechuan Chen
4d735f1903
Add new testcases (#1638)
* Json Primitive Tests

* Json Tree Writer tests

* Add Tests for ISO8601Utils

* Add Tests for ISO8601Utils
2020-02-17 14:55:19 -08:00
Paul Kassianik
21fc362a7e Fixed tests for java 11 (#1454) 2019-10-04 11:29:13 -07:00
Degubi
7845c38077 Minor cleanups in deprecations and other warnings (#1522) 2019-10-03 15:49:24 -07:00
Degubi
63ee47cb64 Refactor uppercaseFirstLetter, add additional field to test (#1515) 2019-04-26 15:49:22 -07:00
Degubi
c5a3f21fba Refactor JsonParser to statics & fix tests 2019-04-15 22:35:10 -04:00
Jake Wharton
a817604a41 Add test coverage for passing null to JsonPrimitive constuctors 2019-03-11 10:50:22 -04:00
Lorenz Nickel
b75e1bbc79 Code cleanup (Removed spaces) (#1474)
* Removed double spaces in comments

* Unified comments

* Removed space

* Removed spaces in code
2019-03-03 11:18:06 -08:00
Mike Cumings
e2296f42d5 Fix issue with recursive type variable protections to fix #1390
When a type variable is referenced multiple times it needs to resolve
to the same value.  Previously, the second attempt would abort
resolution early in order to protect against infinite recursion.
2018-09-25 16:09:48 -07:00
inder123
d84e26d80c
Issue 1242: Printing Gson version when throwing AssertionError and IllegalArgumentException (#1321)
On some versions of Android (probably on some variants of the popular Samsung S4 phone), an older version of Gson is suspected to be bundled in, and gets picked up from the system classpath.
For those versions, the applications that include the latest Gson fail unexpectedly. This debug print will help confirm this issue.
2018-05-17 09:41:21 -07:00
inder123
a6890bbaba
Fixed https://github.com/google/gson/issues/1310 (#1311)
* Fixed https://github.com/google/gson/issues/1310

Also renamed VersionUtils to more readable abstraction JavaVersion
Added support for debian naming convention
Using min supported version (6) as the default if JDK version can't be figured out

* Moved JavaVersion to an internal package
2018-05-09 13:10:08 -07:00
inder123
049bf84e68
Using sun.misc.Unsafe only through reflection to avoid binary dependency (#1306)
If sun.misc.Unsafe not found on Java 9, try field.setAccessible
Also removed exception traces when sun.misc.Unsafe or override are not found
2018-05-01 09:57:45 -07:00
inder123
1b28ff3cda
Added a test for deserialization of fields using lowercase-dot naming policy (#1303) 2018-04-27 18:54:48 -07:00
Leon
ab35f11077 add FieldNamingPolicy.LOWER_CASE_WITH_DOTS (#1278) 2018-04-27 18:50:08 -07:00
Lyubomyr Shaydariv
bdea5b9e99 Removed the executable flag from clearly text files 2018-04-26 10:23:15 +03:00
Inderjeet Singh
4081dbaa6d Added a test for serialization/deserialization of enum classes with
fields
2018-03-17 16:00:46 -07:00
Andrey Mogilev
0aaf5ff408 fix Java9 DateFormat changes (#1211)
* fix Java9 DateFormat changes

* fix Codacy warnings
2017-12-30 00:44:43 +05:30
Andrey Mogilev
b1fb9ca9a1 fix issue #1107: resolve element type in wildcard collection types (#1146)
* fix issue #1107: resolve element type in wildcard collection types

* fix Codacy warnings

* fix Codacy warnings
2017-09-21 17:50:41 -07:00
Warren Smith
08bbb226f1 Add newBuilder() API (#1142)
* Add Gson.newBuilder API.

* Remove redundant test.

* Address Codacy comments.

* Reduce visibility of GsonBuilder constructor.
2017-09-20 18:53:10 -07:00
Lyubomyr Shaydariv
7a9fd5962d Fixed DefaultDateTypeAdapter nullability issue and JSON primitives contract (#1100)
* Fixed DefaultDateTypeAdapter nullability issue and JSON primitives contract

Regression in:

* b8f616c939 - Migrate DefaultDateTypeAdapter to streaming adapter (#1070)

Bug reports:

* https://github.com/google/gson/issues/1096 - 2.8.1 can't serialize and deserialize date null (2.8.0 works fine)
* https://github.com/google/gson/issues/1098 - Gson 2.8.1 DefaultDateTypeAdapter is not null safe.

* Fixed DefaultDateTypeAdapter nullability on write
2017-09-17 23:49:13 -07:00
Andrey Mogilev
03a72e752e Fix StackOverflowError on resolving types with TypeVariable recursion (#1128)
* Fix StackOverflowError on resolving types with TypeVariable recursion

Sample failing code:
  private static class TestType<X> {
    TestType<? super X> superType;
  }
  ...
  new Gson().getAdapter(TestType.class);

* fix build errors
2017-07-31 10:50:29 -07:00
Mike
ada597e69a value(double) can write NaN and infinite values when lenient, as value(Number) does (#1093)
* Added test which shows that lenient JsonWriter fails writing infinite primitive doubles, but does not fail writing boxed doubles, as stated in #1090.

* Fixed JsonWriter#value(double) to write infinite and NaN values when lenient, as JsonWriter#value(Number) does. (fixes #1090)
2017-05-31 09:50:44 -07:00
Lyubomyr Shaydariv
b8f616c939 Migrate DefaultDateTypeAdapter to streaming adapter (#1070) 2017-05-30 18:12:50 -07:00
Andrey Mogilev
a300148003 Fix StackOverflowError on resolving recursive types by collapsing chains of type bounds (#1075)
* Fixes StackOverflowError on resolving recursive types.

See Issue #440, Issue #603, tests.

* fix 'codacy' coding style warnings

* added copyright header
2017-05-30 17:47:04 -07:00
Lyubomyr Shaydariv
eb27d55f49 Remove helper methods mentioned in the TODO list 2017-04-23 15:54:10 +03:00
inder123
5412f21431 Printing more debugging information to help track an invalid JsonAdapter. (#1068)
Now the thrown exception carries this information:
java.lang.IllegalArgumentException: Invalid attempt to bind an instance of java.lang.Integer as a @JsonAdapter for com.google.gson.functional.JsonAdapterAnnotationOnClassesTest$D. @JsonAdapter value must be a TypeAdapter, TypeAdapterFactory, JsonSerializer or JsonDeserializer.
2017-04-19 17:08:21 -07:00
Michele Vivoda
9a2421997e negative zero test and fix (#1069) 2017-04-19 14:26:36 -07:00
André Rouél
9e6f2bab20 Fix ArrayIndexOutOfBoundsException when skipping a value with JsonTreeReader #1013 (#1014) 2017-02-15 18:41:39 -08:00