Jesse Wilson
6a3e83a741
Javadoc for TypeAdapterFactory in @JsonAdapter.
2014-08-05 15:00:15 +00:00
Jake Wharton
117d8ea68f
Add TypeAdapterFactory support to @JsonAdapter.
2014-08-04 16:58:41 +00:00
Jesse Wilson
125e6d9d3d
Change field annotations to take precedence over registered type adapters.
2014-08-02 18:22:43 +00:00
Inderjeet Singh
f9a302e22a
incorporated code review feedback. Added a test to ensure JsonAdapter validation doesn't carry side-effects to other fields
2014-08-01 02:16:42 +00:00
Jesse Wilson
fbc7e69c81
Implement JsonPath in JsonReader.
2014-07-31 05:17:54 +00:00
Inderjeet Singh
80bbf4a85a
revised JsonArray.set() method to return the JsonElement. (thanks Buchholz Bastian for catching that!)
2014-07-04 17:31:43 +00:00
Inderjeet Singh
b9578a4d7e
renamed JsonArray.has() to JsonArray.contains()
2014-07-04 02:03:34 +00:00
Inderjeet Singh
94e21eca21
renamed JsonArray.contains() to has() to be consistent with JsonObject.has()
2014-07-03 17:31:07 +00:00
Inderjeet Singh
06282a4d13
Fixed issue code.google.com/p/google-gson/issues/detail?id=353 by adding set method in JsonArray
2014-07-02 18:30:17 +00:00
Inderjeet Singh
9bbdcac5a8
Fixed issue code.google.com/p/google-gson/issues/detail?id=353 by adding remove and contains methods in JsonArray
2014-07-02 18:21:36 +00:00
Jesse Wilson
c6752fc47a
Fix inverted docs in ExclusionStrategy.
2014-06-04 04:30:19 +00:00
Jesse Wilson
a411a766f7
Leitch --> Wilson !
2014-05-23 05:43:39 +00:00
Inderjeet Singh
14ba59fa88
code review fixes. Moved getFirstArgument() method from $Gson$Types to GsonTypesTest.
2014-05-19 17:34:25 +00:00
Inderjeet Singh
b373c20136
Fixed issue 552 by documenting when fromJson returns null.
2014-03-29 23:28:52 +00:00
Inderjeet Singh
c53e255105
Fixed typo as mentioned in issue 565
2014-03-26 18:07:59 +00:00
Inderjeet Singh
edf66083e6
renamed @Adapt to @JsonAdapter
2014-03-26 17:59:54 +00:00
Inderjeet Singh
7f6a096030
renamed JsonAdapter annotation to Adapt annotation.
2014-03-09 23:08:54 +00:00
Inderjeet Singh
6e8d3cd65e
Created threadsafe implementation of JsonAdapter invocation. Also fixed a bug where runtime generated typeadapters were being carried over from a toJson/fromJson call to the next.
2014-03-09 23:00:53 +00:00
Inderjeet Singh
e280ffd7e2
Fixed broken test to ensure that a field JsonAdapter annotation supersedes the class JsonAdapter annotation.
...
Added a map in Gson to keep track of TypeAdapters which are generated by Gson.
2014-03-09 08:36:24 +00:00
Inderjeet Singh
0922af5be6
removed invalid imports
2014-03-09 08:23:05 +00:00
Inderjeet Singh
67af0dd8f8
Added javadoc comment in JsonAdapter explaining the usage for fields.
...
Added a (broken) test the ensure a field annotation for JsonAdapter supersedes a class annotation.
2014-03-09 08:21:06 +00:00
Inderjeet Singh
f88eee094c
removed some eclipse warnings
2014-03-09 07:33:08 +00:00
Inderjeet Singh
eaaa2a1b4f
added functional tests for applying JsonAdapter annotation on Fields.
2014-03-09 07:31:02 +00:00
Inderjeet Singh
b9998e511f
deleted support for the magic GSON_TYPE_ADAPTER field
2014-03-09 07:30:37 +00:00
Inderjeet Singh
bf549f0589
Added support for JsonAdapter annotation on fields
2014-03-09 07:28:04 +00:00
Inderjeet Singh
67d512ee7d
Created a JsonAdapter annotation that can be applied to classes to indicate their TypeAdapter.
2014-03-08 22:37:19 +00:00
Inderjeet Singh
7c97ac2944
Updated Gson version to 2.3-SNAPSHOT since this is a new feature.
...
Added support for a magic field GSON_TYPE_ADAPTER in a class. This adapter is automatically invoked if present.
The field must be present in the class (not in any super-type), and must be strongly typed as TypeAdapter<T>.
2014-03-08 20:08:13 +00:00
Inderjeet Singh
b2a9d872db
deleted redundant and invalid precondition.
2014-03-08 19:33:24 +00:00
Inderjeet Singh
c3d0f200b3
Fixed a bug where an inner static class was incorrectly marked as non-static while creating parameterized types.
2014-03-08 19:12:24 +00:00
Inderjeet Singh
b52f692ffa
update various maven plugin versions
2014-03-08 17:30:15 +00:00
Inderjeet Singh
eb817e307f
added snapshot repository in pom.xml
2013-09-03 17:49:15 +00:00
Inderjeet Singh
c235aa0c1b
updated the id of the sonatype nexus staging repository.
2013-09-02 19:27:44 +00:00
Inderjeet Singh
2b95a4822b
added distribution management section to pom
2013-09-01 23:42:08 +00:00
Jesse Wilson
1840466704
Fix a nasty bug where elements in LinkedHashTreeMap could be dropped.
...
The underlying problem is that the doubleCapacity function would drop the parent links when all nodes ended up on the same side in a doubling. This was caused by the fact that the AvlIterator was destructive on parent nodes, and we weren't putting them back together with the AvlBuilder. This removes an incorrect optimization and fixes the problem.
Also move LinkedHashTreeMap back into main from test.
2013-05-14 21:43:20 +00:00
Joel Leitch
d2b660570e
2.2.4 JavaDoc.
2013-05-13 21:45:29 +00:00
Joel Leitch
6f19060e14
[maven-release-plugin] prepare for next development iteration
2013-05-13 21:36:45 +00:00
Joel Leitch
b378548c5c
[maven-release-plugin] prepare release gson-2.2.4
2013-05-13 21:36:39 +00:00
Joel Leitch
8834343861
Moving broken class to "test" package for now and disabling broken test.
2013-05-13 21:01:33 +00:00
Joel Leitch
2d5cab1b7b
Fix hashing in LinkedHashTreeMap, but it still does not work :(
2013-05-13 20:40:07 +00: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
Joel Leitch
f29d5bc37b
Create a LinkedTreeMap based on the LinkedHashTreeMap; however, removed all the hashing from it as resorted to a single tree. The insertion order is still preserved.
2013-05-03 16:11:16 +00:00
Joel Leitch
7c9fd53c78
Fix test that expects an exception to fail if no exception is thrown
2013-05-03 15:34:58 +00:00
Joel Leitch
b88e0e9395
Test to expose edge doubling and rehashing bug in LinkedHashTreeMap.
2013-05-03 15:13:30 +00:00
Joel Leitch
8e8bb9c688
Added test for comments inside a string value.
2013-04-14 21:36:47 +00:00
Inderjeet Singh
93041211d1
2.2.3 javadocs
2013-04-12 21:51:58 +00:00
Inderjeet Singh
d831f42168
[maven-release-plugin] prepare for next development iteration
2013-04-12 21:31:10 +00:00
Inderjeet Singh
f002374e22
[maven-release-plugin] prepare release gson-2.2.3
2013-04-12 21:31:02 +00:00
Inderjeet Singh
16a21719ff
updated maven plugin versions
2013-04-12 21:28:11 +00:00
Inderjeet Singh
6347e9b9c6
ensuring that LinkedHashTreeMap.contains() returns false when non-Comparable() keys are passed to it
2013-04-12 21:10:21 +00:00
Inderjeet Singh
6f0a6a4662
made inner classes static and final
2013-04-12 20:20:53 +00:00
Inderjeet Singh
ae034b5ca2
eliminated eclipse warnings by adding a default label to switch.
2013-04-12 20:14:50 +00:00
Inderjeet Singh
a3f11150cc
removed more eclipse warnings
2013-04-12 20:12:12 +00:00
Inderjeet Singh
26016ca66e
removed eclipse warnings, unused fields. Made inner classes static where possible.
2013-04-12 20:09:08 +00:00
Joel Leitch
70f9280cb6
Remove usage of StringPool as it appears to slow things down and avoid Java String intern for the common cases.
2013-04-08 18:36:23 +00:00
Joel Leitch
83e1f45653
Re-add non-comparable key tests to LinkedHashTreeMap.
2013-04-04 22:29:29 +00:00
Inderjeet Singh
c22ab9767d
fixed https://code.google.com/p/google-gson/issues/detail?id=491 by adding OSGi entries for maven-source-plugin
2013-04-04 22:05:56 +00:00
Inderjeet Singh
edd6c19670
deleted unused enum and reordered imports
2013-04-04 21:40:05 +00:00
Joel Leitch
af6aa5f782
Use the LinkedHashTreeMap instead of LinkedTreeMap and delete the LinkedTreeMap version.
2013-04-04 21:31:23 +00:00
Inderjeet Singh
7d53113ebc
fixed https://code.google.com/p/google-gson/issues/detail?id=509 by adding construction for EnumSet
2013-04-04 21:15:50 +00:00
Jesse Wilson
63142f621c
Use the right method name in error messages.
...
Fixes issue 498.
2013-02-04 16:05:00 +00:00
Jesse Wilson
6a69c603c0
Permit serialization of "Class" fields, but only if they're null.
2013-02-04 15:52:51 +00:00
Joel Leitch
edf326e756
Tag member fields as transient since a LinkedHashMap is used for serialization.
2013-01-15 20:04:26 +00:00
Joel Leitch
5af92f1736
Additional changes to a map test with "null" string key.
2013-01-14 22:18:07 +00:00
Joel Leitch
6dc6b4be92
Fix object leak from ThreadLocal.
2013-01-14 22:05:28 +00:00
Joel Leitch
e5b9b8eb81
Minor addition to the JsonNullTest.
2013-01-14 18:40:23 +00:00
Joel Leitch
84201c015f
Do not peek during a "skipValue" if a value has already been peeked.
2013-01-14 18:38:46 +00:00
Joel Leitch
3f2efac95e
Stop blowing up on a null key, but rather return that the element is not found.
2013-01-09 23:37:38 +00:00
Joel Leitch
b0531e1649
Ensure "excluder" is added prior to user defined type adapters/factories.
...
- Added test expose bad behaviour.
2012-12-20 19:41:33 +00:00
Joel Leitch
6d90f0d894
Make JsonElement TypeAdapterFactory a type hierarchy factory.
2012-12-20 07:57:17 +00:00
Jesse Wilson
b4d51db776
Add a test case for a problem reported on the group.
...
https://groups.google.com/d/topic/google-gson/EBmOCa8kJPE/discussion
2012-10-29 16:30:33 +00:00
Joel Leitch
040bae34d7
Allowing instance creators to be registered with the raw type only (without specifying type parameters).
2012-10-24 20:40:44 +00:00
Jesse Wilson
af4879dbb7
Move interceptors from 'alpha' to 'extras'.
...
This makes the feature less risky to use! It now uses our
TypeAdapterFactory infrastructure rather than relying on
parallel infrastructure.
2012-10-23 17:36:30 +00:00
Jesse Wilson
1e18dce002
Don't subclass ThreadLocal.
...
This attempts to address issue 402, wherein subclassing ThreadLocal is pinning a reference to a class, which transitively pins the entire application in containers like Tomcat.
2012-10-23 02:41:34 +00:00
Jesse Wilson
22c835f2bc
Fix compile warnings
2012-10-23 02:40:14 +00:00
Inderjeet Singh
fd4fbe4132
Added support for collections, maps, and arbitrary depth of type adapters for Intercept annotation.
...
Added more tests for the features.
2012-10-18 02:37:43 +00:00
Inderjeet Singh
714ac8e643
added tests for using intercept in fields and lists. These tests are currently failing.
2012-10-11 20:29:40 +00:00
Inderjeet Singh
c25278b4d6
Created an alpha package that holds experimental feature.
...
Added support for JsonPostDeserializer that allows you to invoke postDeserialize methods on an Gson deserialized object.
2012-10-11 03:20:36 +00:00
Joel Leitch
14f16e2d0c
Adding Red-Black Tree implementation and tying it into the Gson bindings.
2012-10-11 03:15:49 +00:00
Jesse Wilson
2fef83799d
Optimizations and bug fixes for LinkedHashTreeMap.
...
The most interesting optimization is to replace ArrayDeque with a manual linked list that reuses the nodes 'parent' field. These optimizations save about 20%.
2012-09-17 03:30:20 +00:00
Jesse Wilson
aceadaecf1
Add a hashing layer to LinkedTreeMap. Instead of having 1 root node, the class now has several root nodes, one for each hash bucket in a hash table.
...
Compared to LinkedTreeMap, this is slower for small (size=5) maps: 124% slower to get() and 33% slower to create and populate. It's a win for large (size=500) maps: 46% faster to get() but 8% slower to create and populate. And it's a big win for very large (size=50,000) maps: 81% faster to get() and 46% faster to create and populate.
http://microbenchmarks.appspot.com/run/limpbizkit@gmail.com/com.google.common.collect.MapBenchmark
I'm going to follow this up with some simple optimizations: caching local fields and simplifying access. That should narrow the performance gap.
2012-09-17 00:19:44 +00:00
Jesse Wilson
a0493b9732
New code that can split an AVL tree into two AVL trees.
...
This is in preparation for a new feature where LinkedTreeMap will have multiple roots, each in its own hash bucket.
2012-09-15 06:13:33 +00:00
Jesse Wilson
01bd0d92e2
Tests for LinkedTreeMap with incompatible keys.
2012-09-12 05:06:48 +00:00
Jesse Wilson
a6ab854302
Fix a bug where we were unlinking nodes that shouldn't have been unlinked.
...
Found by Guava's awesome collections test suite!
2012-09-12 04:41:58 +00:00
Jesse Wilson
93e38901df
Draft of LinkedTreeMap. Its ordered like a LinkedHashMap but it doesn't do any hashing for DoS resistance.
...
Not yet adopted in our code.
Known critical bugs:
- throws ClassCastException when get() is called with a non-comparable key
- throws NullPointerException on get(null)
2012-09-10 20:04:38 +00:00
Jesse Wilson
084047d80b
Reintroduce string pooling in JsonReader.
...
This makes Hotspot slower. From my before/after measurements using ParseBenchmark, times in microseconds:
TWEETS: 350 -> 370 (+6%)
READER_SHORT: 77 -> 76 (-1%)
READER_LONG: 870 -> 940 (+8%)
But it makes Dalvik faster by a greater margin. These before/after measurements use times in milliseconds:
TWEETS: 25 -> 20 (-20%)
READER_SHORT: 5.6 -> 4.7 (-16%)
READER_LONG: 52 -> 47 (-10%)
It's a net win because we're saving a greater fraction of time, and because we're helping the platform that needs the most help. We're paying microseconds on Hotspot to gain milliseconds on Dalvik.
2012-09-10 16:13:33 +00:00
Inderjeet Singh
d1ff7bb397
Deleted spurious directory gson-codegen. The real codegen code is in trunk/codegen
2012-09-04 21:10:12 +00:00
Jesse Wilson
411c5c0b50
Follow up on r1197 and make deepCopy package-private. We don't want to use protected because some of the classes are non-final and protected shows up in the Javadocs.
2012-09-03 23:30:27 +00:00
Inderjeet Singh
a973837dd4
made deepCopy protected to eliminate it from the public API for now.
...
It will be in the subsequent release.
2012-09-03 08:34:37 +00:00
Jesse Wilson
8df7209074
Fix cut & paste issue in JsonToken Javadocs.
...
Fixes issue 463.
2012-09-02 21:29:30 +00:00
Jesse Wilson
b3b919770b
Change number parsing to use one big loop. This changes it to return JsonToken.STRING for very long (>8k digits) numbers.
2012-09-02 20:12:19 +00:00
Jesse Wilson
3920d95fac
rename peekedInteger to peekedLong
2012-09-02 17:46:02 +00:00
Jesse Wilson
8daf3aaeb4
Inline position computation. This is uglier but faster.
2012-08-28 03:52:18 +00:00
Jesse Wilson
46b73632b0
Fix a bug where we weren't reading enough characters when a BOM was encountered.
2012-08-28 01:48:25 +00:00
Jesse Wilson
980796005f
Use a conventional for loop in nextQuotedValue() to make hotspot's job easier.
2012-08-27 04:42:39 +00:00
Jesse Wilson
bdf2cac6d4
Replace switch with if/else when processing whitespace. If/else is faster!
2012-08-27 04:17:29 +00:00
Jesse Wilson
b0a172944a
More number parsing improvements.
2012-08-27 03:17:41 +00:00
Jesse Wilson
448063dde1
Fix a goof in number parsing.
2012-08-27 03:07:20 +00:00
Jesse Wilson
4c2980e6ff
Fix a bug in integer parsing.
2012-08-27 02:34:52 +00:00
Jesse Wilson
c7cb503cdb
Restore fast skips.
...
document api ns linear runtime
TWEETS GSON_STREAM 397568 =========
TWEETS GSON_SKIP 300058 =======
READER_SHORT GSON_STREAM 76632 =
READER_SHORT GSON_SKIP 57796 =
READER_LONG GSON_STREAM 894690 =====================
READER_LONG GSON_SKIP 565114 =============
2012-08-27 01:17:50 +00:00