Anirudh Ramanan
9e44d60b83
Eliminating code overhead
...
* calculating size of the list once in case of loops, avoided creation of string builder object if the length type argument is 0
* replaced null check boilerplate code with nullSafe()
2017-03-01 11:13:56 -05:00
Mohammad Yasir
4644837207
Incorporating the review comments. While more than 1 charachter might be read from the buffer the output will have only one escaped charachter.
2017-02-17 11:54:30 +05:30
Jesse Wilson
2d072bae3a
Merge pull request #1015 from yasirmhd/master
...
Memory optimisation in JsonReader
2017-02-16 22:58:16 -05:00
Mohammad Yasir
9c30b0e203
Incorporating code review suggestions
2017-02-17 07:25:23 +05:30
André Rouél
9e6f2bab20
Fix ArrayIndexOutOfBoundsException when skipping a value with JsonTreeReader #1013 ( #1014 )
2017-02-15 18:41:39 -08:00
Mohammad Yasir
ba4643134a
Removing unused variable
2017-02-16 03:00:02 +05:30
Mohammad Yasir
410b4a8c62
Optimizing for memory
2017-02-16 02:51:02 +05:30
BloodShura
9d8d7a43e1
All JsonElement::getAsJsonXXX methods now include the JSON string on thrown exception's message
2017-02-07 22:04:22 -02:00
Martin Lind
08c7bffba0
Fix for #957 ( #994 )
2017-01-11 10:38:33 -08:00
Yutaro Iino
9e5e4ac630
Add missing comma in toString()
2016-12-21 00:10:42 +09:00
Mark Hess
4976e420fc
Add keySet method and test ( #942 )
2016-12-13 22:15:49 -08:00
Kevin Most
5f73666404
Update JsonAdapter documentation ( #976 )
...
Include mention of JsonDeserializer and JsonSerializer.
2016-12-11 22:37:55 -08:00
Egor Neliuba
44cad04a63
Allow deserialization of a Number represented as a String ( #964 )
2016-11-25 23:40:14 -08:00
jwilson
14c8c1a82b
[maven-release-plugin] prepare for next development iteration
2016-10-26 23:01:41 -07:00
jwilson
e9ead40302
[maven-release-plugin] prepare release gson-parent-2.8.0
2016-10-26 23:01:37 -07:00
Inderjeet Singh
688f918a35
Added @Documented to Gson annotations.
...
This is useful since it shows the JSON format for a class which the user of that class should typically know.
2016-09-15 18:24:21 -07:00
Jake Wharton
9414b9b3b6
Add static factories for array and parameterized type tokens.
...
These are useful when creating TypeAdapterFactories that delegate to others with more complex types. They also are useful when writing dynamic code that deals with types that cannot be fully reified using the normal subclass technique.
2016-08-12 12:11:57 -04:00
testcenter
193349f4aa
made nullSafe wrapper of JsonAdapter optional
2016-06-28 09:18:03 +02:00
Inderjeet Singh
0a29fcf859
[maven-release-plugin] prepare for next development iteration
2016-06-14 16:52:32 -07:00
Inderjeet Singh
9722b00372
[maven-release-plugin] prepare release gson-parent-2.7
2016-06-14 16:52:28 -07:00
Inderjeet Singh
687ddb319e
Preparing 2.7-SNAPSHOT to cut the 2.7 release.
2016-06-14 16:39:19 -07:00
inder123
b2c00a3b02
Merge pull request #873 from google/jwilson.0601.get_delegate_adapter
...
Add support for JsonSerializer/JsonDeserializer in the JsonAdapter annotation
2016-06-14 16:37:14 -07:00
Inderjeet Singh
1f859ec769
addressed code review comments.
2016-06-14 16:34:34 -07:00
Jesse Wilson
c24af30407
Merge pull request #871 from google/jw/tree-json-path
...
Implement JSON Path for JsonTreeReader.
2016-06-09 23:32:24 -07:00
Jake Wharton
c16be41e77
Expose JsonObject size.
2016-06-10 00:46:32 -04:00
Jake Wharton
c2fae85a9f
Implement JSON Path for JsonTreeReader.
2016-06-10 00:14:28 -04:00
inder123
ebad966efd
Merge pull request #870 from google/jw/reader-location
...
Consolidate location and path rendering for exceptions.
2016-06-09 15:26:10 -07:00
Jake Wharton
ecaa57114f
Consolidate location and path rendering for exceptions.
2016-06-09 18:02:36 -04:00
Archit Dey
3f8726ecaf
Enhancing the json reader, adding corresponding test case for it
2016-06-02 09:19:43 -04:00
jwilson
2df65502ed
Don't use ThreadLocals for @JsonAdapter factories and getDelegateAdapter().
2016-06-02 00:33:09 -04:00
Inderjeet Singh
943c674276
Removed ThreadLocal for activeJsonAdapterClasses
2016-06-02 00:08:25 -04:00
Inderjeet Singh
45511fdd15
Added support for JsonSerializer/JsonDeserializer for JsonAdapter annotation.
...
JsonAdapter is cached per the type of the JsonAdapter class.
Added a test to ensure JsonAdapter works on fields of parameterized types
Keep track of registered JsonAdapters and JsonAdapterFactorys in ThreadLocal.
2016-06-02 00:08:25 -04:00
Jesse Wilson
bb451eac43
Merge pull request #832 from google/831
...
Ensuring that JsonAdapter annotation works correctly for primitive fi…
2016-05-17 17:26:52 -04:00
Inderjeet Singh
3ff16c30db
Don't use a runtime wrapper if a JsonAdapter annotation is present on a field.
...
This ensures that JsonAdapter annotation works correctly on a primitive field.
This is a potentially backward incompatible change.
2016-05-17 13:30:59 -07:00
Inderjeet Singh
61f83d6309
Replaced a JDK 1.7 specific method with its JDK 1.6 equivalent.
2016-05-17 01:03:00 -07:00
Baschdl
c414b368e1
Corrected documentation, copy&paste error
2016-05-12 14:47:03 +02:00
Jake Wharton
371aff7ce4
Switch default Queue implementation to ArrayDeque.
...
Now that we require Java 1.6 or newer this much more efficient implementation can be used as the default.
2016-04-27 00:37:28 -04:00
Jake Wharton
8537c8932f
Optimize list allocation for every reflective field.
...
The common cases (no @SerializedName and a single-value @SerializedName) now use a specialized one-element collection. Cases with alternate names use a much more space efficient ArrayList which is exactly sized.
This is also a performance win for adapter initialization since an index-based loop was used on the returned type for which LinkedList is not suited for.
2016-04-27 00:28:51 -04:00
Ryan Harter
a851569ab9
Adds getters for config fields.
...
This adds simple getters for certain config fields that would be helpful in custom
TypeAdapters to deal with situations like this:
https://github.com/rharter/auto-value-gson/issues/18
2016-04-26 15:30:01 -04:00
Jake Wharton
59edfc1caf
Add boxed boolean value() overload.
...
When calling value() with a Boolean overload resolution would choose value(boolean) which would throw an NPE on null. The other boxed types are all numbers which would resolve to value(Number) and behave correctly.
2016-04-22 19:52:38 -04:00
Jesse Wilson
0f66f4fac4
Merge pull request #829 from ionspin/master
...
Check if class can be instantiated based on class modifiers. Fix for #817
2016-04-22 06:47:08 -10:00
Ugljesa Jovanovic
ab40462cc7
Check if class can be instantiated based on class modifiers. If not throw an unsupported operation exception.
2016-04-20 10:43:34 +02:00
gavlyukovskiy
966de9e60d
fixed throwing RuntimeException instead of JsonIOException
2016-04-15 21:00:59 +03:00
Scott Brown
9c4f352320
minor javadoc fix ... @code block not treated as html
2016-04-08 19:34:05 -06:00
Inderjeet Singh
34d7521d95
moved the JsonSerializationContext/JsonDeserializationContext fields to where they are used.
...
Also moved TreeTypeAdapter to internal.bind package for potential use in JsonAdapterAnnotationFactory.
2016-03-28 14:46:02 -07:00
Scott Brown
0669ff7fd1
allow unquoted long and integer keys
2016-03-12 11:52:13 -07:00
qwwdfsad
31dcfa3ad6
More appropriate usage of null key surrogate in Gson#getAdapter for backward compatibility
2016-03-05 02:08:26 +03:00
qwwdfsad
c5611847a3
Gson synchronized map replaced with concurrent hash map
2016-03-05 00:28:25 +03:00
Inderjeet Singh
416ddb101d
[maven-release-plugin] prepare for next development iteration
2016-02-26 18:31:14 -08:00
Inderjeet Singh
fe62b04148
[maven-release-plugin] prepare release gson-parent-2.6.2
2016-02-26 18:22:26 -08:00
Inderjeet Singh
0dfa28ac3e
previous mvn release:prepare failed but updated GitHub anyway. Fixing that.
2016-02-26 18:19:41 -08:00
Inderjeet Singh
607bcaaf9d
[maven-release-plugin] prepare for next development iteration
2016-02-26 18:14:54 -08: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
Sean Bright
4eff1a855f
Restore OSGi manifest headers
...
Commit 2016e95
removed the necessary MANIFEST.MF headers for Gson to
resolve in an OSGi environment. This patch restores them.
2016-02-24 09:14:09 -05:00
Dongjoon Hyun
aa209fa255
Fix some typos in gson comments.
2016-02-15 14:11:23 -08:00
jwilson
796b4ca26d
[maven-release-plugin] prepare for next development iteration
2016-02-11 22:53:04 -05:00
jwilson
3c9b9af0a1
[maven-release-plugin] prepare release gson-parent-2.6.1
2016-02-11 22:52:59 -05:00
jwilson
85722329db
[maven-release-plugin] prepare for next development iteration
2016-02-11 13:03:12 -05:00
jwilson
b8220eb195
[maven-release-plugin] prepare release gson-parent-2.6
2016-02-11 13:03:10 -05:00
jwilson
2016e9553e
Simplify Gson poms.
...
A lot of the configuration in these poms has been taken over by improvements
to the Maven release plugin.
2016-02-11 12:56:33 -05:00
inder123
8383f5c7fa
Merge pull request #769 from paniko0/master
...
timezones without minutes should be valid according RFC3339
2016-02-02 20:23:52 -08:00
Jake Wharton
c8627c8ab8
Update reader and writer for RFC 7159.
2016-01-18 15:07:33 -05:00
inder123
2ab776b5f5
Merge pull request #771 from google/jw/global-leniency
...
Add setting for leniency on Gson instance.
2016-01-18 14:03:23 -05:00
Jake Wharton
3360c93a76
Add setting for leniency on Gson instance.
...
Add a JsonReader factory (for parity with the JsonWriter one) which provides a configured instance using the Gson settings.
2016-01-18 12:08:11 -05:00
Jerzy Chalupski
23e2916947
Make TypeAdapters created by @JsonAdapter null-safe
2016-01-18 16:41:07 +01:00
Psidium
61f58baaf9
fix typo in JsonArray docs
2016-01-12 11:02:42 -02:00
Danillo Souza
ed6298c98a
timezones without minutes should are valid according RFC3339
2016-01-11 15:33:55 -02:00
inder123
1f803bd37d
Merge pull request #761 from google/jw/nuke-synthetics
...
Remove synthetic accessors from being generated.
2015-12-27 14:08:23 -05:00
Jake Wharton
7a1c94f986
Remove synthetic accessors from being generated.
2015-12-27 01:39:19 -05:00
inder123
59a8fb5c5e
Update pom.xml
2015-12-14 16:48:49 -08:00
Inderjeet Singh
2b4ac2334e
[maven-release-plugin] prepare for next development iteration
2015-11-23 19:32:33 -08:00
Inderjeet Singh
d7d064feb8
[maven-release-plugin] prepare release gson-parent-2.5
2015-11-23 19:32:26 -08:00
Gorik
d86dfdec7c
Removed unused code in ISO8601Utils
2015-11-23 01:21:41 -05:00
Gorik
bcd52a1fdc
Added ISO8601 complete support for date deserialization
2015-11-23 01:11:41 -05:00
inder123
e48c780389
Merge pull request #733 from google/java_util_additional_classes
...
Supported Currency and added additional tests for Vector, Stack and Properties.
2015-11-17 17:57:59 -08:00
Inderjeet Singh
c935f89b23
Added the cause to Assertions
2015-11-16 09:16:23 -08:00
Inderjeet Singh
05b17f9271
Adding details in the throw exception on a missing field.
2015-11-16 09:12:23 -08:00
Inderjeet Singh
10cefa49d2
added tests for Properties
2015-11-06 16:17:47 -08:00
Inderjeet Singh
01944b246b
additional tests for PriorityQueue, Vector and Stack.
2015-11-06 16:16:56 -08:00
Inderjeet Singh
47cc34548d
added currency class
2015-11-06 15:41:15 -08:00
Inderjeet Singh
457f53f08f
renamed JavaUtilConcurrentLocksTest to JavaUtilConcurrentAtomicTest
2015-11-06 15:24:15 -08:00
Inderjeet Singh
da4334b8df
fixed typos
2015-11-05 21:43:10 -08:00
Inderjeet Singh
11b26b5256
Added support for AtomicLongArray.
...
Also added tests to ensure LongSerializationPolicy is honored.
2015-11-05 14:15:46 -08:00
Inderjeet Singh
caef762530
added factory fields for consistency
2015-11-05 14:03:51 -08:00
Inderjeet Singh
cc54e4dbdd
made methods static
2015-11-05 10:46:54 -08:00
Inderjeet Singh
7821b73202
Added support for AtomicInteger, AtomicBoolean, AtomicLong and AtomicIntegerArray.
2015-11-05 10:45:23 -08:00
Inderjeet Singh
fef43b2aaa
Added support to serialize/deserialize ConcurrentMap and ConcurrentNavigableMap.
2015-11-04 21:25:15 -08:00
Inderjeet Singh
79e1c669ed
Linking to JDK 6 javadocs
2015-11-04 18:55:23 -08:00
Inderjeet Singh
e5b3f6368d
updated minimum JDK version to 1.6.
...
Added Overrides for methods implementing an interface.
2015-11-04 18:52:20 -08:00
inder123
fe101c10bc
Merge pull request #719 from google/jwilson_1021_runtime_type_mismatch
...
Fix type hierarchy adapters to do a runtime check.
2015-10-22 09:29:01 -07:00
jwilson
7d1973e6c5
Fix type hierarchy adapters to do a runtime check.
...
Otherwise if we have a type hierarchy adapter for Vehicle, and we
attempt to decode a JSON string as a Car, we get the right exception
if the JSON string is actually decoded as a Truck.
2015-10-21 11:42:30 -04:00
Roman Mazur
3b1671dde9
Fix javadoc of SerializedName
...
In #699 the approach was changed but docs were left for the first implementation.
2015-10-04 19:56:02 +03:00
Inderjeet Singh
d0ee733c96
[maven-release-plugin] prepare for next development iteration
2015-10-03 17:38:26 -07:00
Inderjeet Singh
80c13447ed
[maven-release-plugin] prepare release gson-parent-2.4
2015-10-03 17:38:17 -07:00
Inderjeet Singh
d1883b5e5b
added relativePath to avoid warning about incorrect parent path
2015-10-03 17:37:14 -07:00
Inderjeet Singh
109915d93a
Implemented support for multiple values for SerializedName annotation.
2015-10-03 02:01:30 -07:00
Jesse Wilson
3361030766
Merge pull request #705 from google/627
...
Implemented equals and hashcode for LazilyParsedNumber to fix
2015-09-27 17:25:04 -04:00