Inderjeet Singh
5f4e88f62a
More tests to ensure that serialization works for parameterized types like A<B<C<D>>> without the need to specify type in toJson()
2011-06-25 20:14:09 +00:00
Inderjeet Singh
d347128e6f
Implemented support for serializing objects of type Bar<Foo> without the need to specify their type explicitly in toJson method.
2011-06-25 20:04:14 +00:00
Inderjeet Singh
ef2f73180b
added tests to illustrate and validate that Gson can serialize parameterized types without the need of explicit type token.
2011-06-25 19:43:05 +00:00
Inderjeet Singh
9196b23251
Refactoring: Separated type handler maps into two types: one for system-specified handlers and one for user-specified. system-specified handlers are the ones that Gson comes with (DefaultTypeAdapters).
2011-06-24 21:52:59 +00:00
Jesse Wilson
f74dffc6fd
Add deepCopy to JsonArray and JsonObject.
...
Resolves issue 301.
2011-06-17 21:46:28 +00:00
Joel Leitch
c9ee7adcc5
Start using JsonNull.INSTANCE everywhere and remove creation method.
2011-06-03 19:02:28 +00:00
Inderjeet Singh
60e7c481fd
Added complex map serialization tests in case the Map is defined with TypeVariables.
2011-05-30 09:38:38 +00:00
Inderjeet Singh
f2eb76eac9
removed deprecation warnings by using JsonNull.INSTANCE
2011-05-25 16:48:39 +00:00
Inderjeet Singh
b85daafb08
suppressed unchecked warning
2011-05-11 21:43:47 +00:00
Inderjeet Singh
0bcd1b341f
Revised Gson to refuse to deserialize floating point numbers into integer types.
...
This is probably a break from the past: previous versions of Gson allowed truncating a floating point into a long or int. However, it wasn't consistent in this behavior. It disallowed converting a BigDecimal value into BigInteger, int or long. Refusing to deserialize such values is aligned with fail-fast approach of uncovering bugs.
2011-05-04 23:26:22 +00:00
Inderjeet Singh
824635158c
Parsing numbers lazily as a performance enhancement.
...
This avoids needing to parse number if the equivalent object field doesn't exist.
It also avoids the performance penalty of trying to parse it eagerly as a big decimal, float etc.
2011-04-28 21:57:29 +00:00
Joel Leitch
4efeef1893
Make test a little more complex to show it actually fixed the bug.
2011-04-20 22:32:13 +00:00
Joel Leitch
f291c4d33e
Fix a bunch of preserve-type issues:
...
- Issue 205
- Issue 294
- Issue 318
2011-04-20 22:27:51 +00:00
Joel Leitch
cf3615e38c
Adding tests to verify 294.
2011-04-19 22:18:25 +00:00
Inderjeet Singh
e60274ed35
Added tests to ensure that subclass objects that are of a parameterized type are serialized per their declared type in lists or maps.
2011-04-19 20:49:48 +00:00
Inderjeet Singh
40045dc2e4
Added tests to ensure that subclass objects are serialized per their real type in lists or maps.
...
Currently, this doesnt happen for List and hence the test is marked as disabled.
2011-04-19 20:26:16 +00:00
Joel Leitch
d2cf574e86
Adding unit-tests to verify bugs.
2011-04-15 06:33:09 +00:00
Joel Leitch
c894fb6c23
Default support for BitSet. As well, provide more flexibility on getAsBoolean for a JsonPrimitive.
2011-04-14 02:42:47 +00:00
Joel Leitch
97d00f4930
Add test to verify issue 309.
2011-04-13 16:14:54 +00:00
Joel Leitch
4917fc7f76
Lift restriction on naming when using the "@SerializedNamed" annotation.
...
Fix for Issue 290.
2011-04-12 17:29:19 +00:00
Joel Leitch
49e7ee05fc
Fix method name by making it singular.
2011-04-11 18:44:19 +00:00
Inderjeet Singh
4bd261ae06
Made FieldNamingStrategy2 and its corresponding builder method package-private.
2011-04-07 17:41:35 +00:00
Inderjeet Singh
05ae10a144
removed the constructor in FieldAttributes that was only used in tests.
2011-04-06 00:51:01 +00:00
Joel Leitch
ddb0c8c825
Minor formatting fixes.
2011-04-06 00:43:57 +00:00
Inderjeet Singh
c8bd121db2
Renamed $Preconditions to $Gson$Preconditions and $Types to $Gson$Types.
...
Marked the two private classes in $Types as final.
2011-04-06 00:26:57 +00:00
Joel Leitch
b4eb810347
Comments for r766.
2011-04-06 00:02:40 +00:00
Joel Leitch
f36c1bc222
Very minor cleanup.
2011-04-04 23:17:43 +00:00
Joel Leitch
2fb8c92812
Use more specific type for map serialization if possible.
2011-04-04 23:13:31 +00:00
Inderjeet Singh
542a17c3bc
Incorporated comments from r710
2011-04-04 22:48:34 +00:00
Inderjeet Singh
56b7ab1b71
Incorporated feedback from r718
2011-04-04 22:23:51 +00:00
Inderjeet Singh
feb9617bf0
Incorporated comments from r726
2011-04-04 22:09:51 +00:00
Inderjeet Singh
a147164852
incorporated feedback on r721
2011-04-04 21:43:24 +00:00
Inderjeet Singh
1a9a54dcc2
incorporated review comments from r768
2011-04-04 21:27:37 +00:00
Joel Leitch
21ddfc9b12
Show default serialization and deserialization works with subclasses of an enum type.
2011-04-04 19:19:46 +00:00
Joel Leitch
5af0b16641
Updating Map tests.
2011-04-04 19:07:20 +00:00
Inderjeet Singh
9c894c7485
switched from accessing field to an accessor method for access in tests.
...
Strangely, this fixes the broken tests in the continuous build.
2011-03-31 18:57:55 +00:00
Inderjeet Singh
5bc80cd693
Moved Cache, LruCache, Pair, Primitives and UnsafeAllocator to com.google.gson and made them package private.
2011-03-30 13:59:06 +00:00
Jesse Wilson
46a8e9b411
Test to demonstrate that we've fixed issue 302.
...
http://code.google.com/p/google-gson/issues/detail?id=302
2011-03-29 21:48:03 +00:00
Jesse Wilson
f718784f33
Use the date format for java.sql.Date and java.sql.Timestamp.
...
Fixes issue 230.
2011-03-29 21:36:19 +00:00
Jesse Wilson
4efb133b4a
bling bling
...
Prefix internal classes with $ to prevent them from interfering with IDE's auto import functionality.
2011-03-29 21:24:26 +00:00
Joel Leitch
454f58a7b1
Adding in instance creator to instantiate the concrete Collection or Map class if known, otherwise fallback to a default instance.
...
Also, added some caching as part of the default constructor lookups.
2011-03-29 16:57:28 +00:00
Inderjeet Singh
337d89cf3f
Removed ObjectNavigatorFactory
2011-03-24 20:19:41 +00:00
Inderjeet Singh
13dc7b6f02
Made ObjectNavigator a reusable object. We now use just one instance of ObjectNavigator instead of creating one for each field/object.
2011-03-24 18:41:45 +00:00
Inderjeet Singh
005c93e383
removed unused no-args constructors
2011-03-23 18:48:03 +00:00
Joel Leitch
861e047a62
Create an "internals" package for classes that we do not want to share, but is needed across multiple pacakges.
...
As well, move non-Gson specific classes, such as Preconditions, to this new "internals" package.
2011-03-21 22:30:35 +00:00
Jesse Wilson
657688ca79
Test that the date format is honored, even in a collection.
...
http://code.google.com/p/google-gson/issues/detail?id=230
2011-03-21 22:10:33 +00:00
Jesse Wilson
e96b241556
Test that we can serialize classes whose fields are concrete collections.
2011-03-21 21:49:38 +00:00
Joel Leitch
279c0e87ed
Update Precondition checks and have it throw a NPE instead.
2011-03-16 07:23:44 +00:00
Joel Leitch
a9507250f9
Add test for multiple calls to register complex map key serialization.
2011-03-15 15:41:19 +00:00
Joel Leitch
ba0cd254a9
Clean up warnings.
2011-03-15 15:38:17 +00:00