Commit Graph

286 Commits

Author SHA1 Message Date
Inderjeet Singh
8d3bfc0f47 Marked the getTypeInfoForField() method package private as it was inadvertently marked public.
Removed commented out code in pom.xml that is now obsoleted with sonatype syncing.
2011-04-06 00:13:31 +00:00
Joel Leitch
b4eb810347 Comments for r766. 2011-04-06 00:02:40 +00:00
Joel Leitch
52bf144859 Comments for r767 2011-04-05 23:57:13 +00:00
Joel Leitch
dc283e1121 Fixed comments from r774. 2011-04-05 23:36:05 +00:00
Joel Leitch
944081327b More very minor cleanup. 2011-04-04 23:18:25 +00:00
Joel Leitch
f36c1bc222 Very minor cleanup. 2011-04-04 23:17:43 +00:00
Joel Leitch
7c42ef3e5d Update incomplete comment. 2011-04-04 23:16:44 +00:00
Joel Leitch
2fb8c92812 Use more specific type for map serialization if possible. 2011-04-04 23:13:31 +00:00
Inderjeet Singh
50b4e3f4b9 Using getElement() instead of get() to get proper synchronization. 2011-04-04 23:00:19 +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
bf4ab04413 replaced multiple caches in ReflectingFieldNavigator with a single one.
Two additional optimizations:
- storing the field list for the entire type hierarchy in the cache instead of navigating it every time.
- storing the resolved type for the field in FieldAttributes instead of using reflection every time.
2011-04-01 23:54:41 +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
Inderjeet Singh
523f489863 Got rid of an unneeded method. 2011-03-29 21:38:08 +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
5e74dabad9 Re-use Preconditions instead of re-writing them here. 2011-03-29 21:18:27 +00:00
Jesse Wilson
9bcb0c0b6b Use the internal copy of preconditions 2011-03-29 21:13:31 +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
ad921a0ee8 removed unused variable. eliminated unnecessary ObjTypePair creation. 2011-03-24 22:37:03 +00:00
Inderjeet Singh
4d9bec2206 Caching inheritance hierarchy for a type to reduce performance impact of reflection. 2011-03-24 22:28:45 +00:00
Inderjeet Singh
4a58dc3e2a Moving AccessibleObject.setAccessible to where the fields are obtained by reflection. 2011-03-24 22:16:25 +00:00
Inderjeet Singh
0adf7f5e17 Caching fields for a class for reducing the need for reflection. 2011-03-24 22:13:51 +00:00
Inderjeet Singh
337d89cf3f Removed ObjectNavigatorFactory 2011-03-24 20:19:41 +00:00
Inderjeet Singh
b51ffc1060 Removed eclipse warnings about missing overrides and declared exceptions that are never thrown. 2011-03-24 20:08:56 +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
b819307de8 refactored the field navigation using reflection out of ObjectNavigator. 2011-03-24 18:28:23 +00:00
Inderjeet Singh
6d3e0e92a5 Added a cache for no-args constructors to avoid expensive reflection everytime an object needs to be instantiated. 2011-03-23 18:31:39 +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
Joel Leitch
279c0e87ed Update Precondition checks and have it throw a NPE instead. 2011-03-16 07:23:44 +00:00
Joel Leitch
7b223a8983 Adding JavaDoc to the enableComplexMapKeySerialization method on GsonBuilder. 2011-03-16 07:05:24 +00:00
Joel Leitch
ba0cd254a9 Clean up warnings. 2011-03-15 15:38:17 +00:00
Joel Leitch
e57ef0908b Add method to GsonBuilder to enable complex key serialization of maps. 2011-03-15 15:37:41 +00:00
Inderjeet Singh
0c35edab65 Fixed the bug where copyOf() for a ParameterizedTypeHandlerMap was failing when hierarchical type adapters for a sub class and its base class were present.
Fixed previously broken tests to verify the behavior that a hierarchical type adapter for a sub-class can be registered after registering a hierarchical type adapter for the base-class. The vice-versa is not allowed as it would result in hiding the sub-class hierarchical type adapter.
2011-03-14 23:22:50 +00:00
Jesse Wilson
ef7bd4c999 Don't document an API that we don't offer! 2011-03-14 21:50:14 +00:00
Inderjeet Singh
b489f4fb01 marked default type adapters as final classes 2011-03-11 22:20:39 +00:00
Inderjeet Singh
e26a6d5c18 removed the wrapping (regarding exception handling) of some primitive deserializers (numbers and boolean).
Added a number of additional tests that cover the cases of attempts to deserialize JsonObjects or arrays as primitives that must fail.
2011-03-11 22:14:18 +00:00
Jesse Wilson
43137b6b4f Fix unsafe allocations on Android 2011-03-11 00:44:15 +00:00
Inderjeet Singh
28567508ea Corrected Javadocs to indicate that NumberFormatException gets thrown instead of ClassCastException while attempting to convert a JsonPrimitive to a number. 2011-03-11 00:14:49 +00:00
Inderjeet Singh
baf9591d3b Made constructors package private for package private classes. 2011-03-10 23:55:16 +00:00
Inderjeet Singh
4e4f9b3a69 Preconditions.checkState() now throws IllegalStateException instead of IllegalArgumentException. This will potentiallly break backwards compatibility.
Removed unhelpful message while constructing exceptions.
2011-03-10 23:19:58 +00:00
Inderjeet Singh
52288d7127 rawtypes -> unchecked
Fixed spurious eclipse warnings on deprecation, missing classes or parameters, etc.
2011-02-24 22:47:55 +00:00
Inderjeet Singh
4be9767a28 removed unused imports 2011-02-24 20:18:03 +00:00
Jesse Wilson
3d006c90a2 equals & hashCode for subclasses of JsonElement.
Resolves issue 64.
2011-02-15 00:14:20 +00:00
Joel Leitch
4c41b11fce Comments from r723. 2011-02-14 22:26:17 +00:00
Joel Leitch
451a9dbe66 Add ability to allocate memory for an object without the use of the default constructor. 2011-02-11 18:22:07 +00:00
Jesse Wilson
b649f2768c Support unquoted single word strings in lenient mode!
Fixes issue 282.
2011-02-10 01:36:27 +00:00
Jesse Wilson
6e81cfdbb4 Locale-awareness for date parsing and formatting:
- always format in en_US for best interchange
 - always parse in en_US, system locale and ISO-8601
2011-02-10 01:06:22 +00:00