My favorites | Sign in
Project Logo
Project hosting will be READ-ONLY Wednesday at 8am PST due to brief network maintenance.
             
New issue | Search
for
| Advanced search | Search tips
Issue 35: Gson should support Parameterized types with variable types as parameters
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  joel.leitch
Closed:  Aug 2008
Type-Defect
Priority-Medium


Sign in to add a comment
 
Reported by inder123, Aug 21, 2008
If a field is of wild-card type, Gson should be able to handle it. 

class Foo<? extends Number> {
}

Class Bar {
  Foo<Integer> foo;
} 

should serialize and deserialize correctly.
Comment 1 by joel.leitch, Aug 24, 2008
We also need to handle the following:

public class B<T> {
  List<T> list;
  List<T>[] arrayList;
}

NOTE: I've added some tests that are currently failing, but should pass once this is
supported.
Comment 2 by joel.leitch, Aug 24, 2008
(No comment was entered for this change.)
Summary: Gson should support Wildcard types and Parameterized types with with variable types as parameters
Comment 3 by joel.leitch, Aug 24, 2008
(No comment was entered for this change.)
Summary: Gson should support Wildcard types and Parameterized types with variable types as parameters
Comment 4 by joel.leitch, Aug 28, 2008
The supporting code is in r211.  With this change, an instance of class B above can
be serialized/deserialized properly.

- Added support for ParameterizedTypes where at least one type parameter is a
TypeVariable.
- Added support for GenericArrayTypes where the ParameterizedType has a
"TypeVariable" as one of its type parameters.

Marking this issue as fixed and will reopen another issue for the Wildcard types.
Summary: Gson should support Parameterized types with variable types as parameters
Status: Fixed
Owner: joel.leitch
Sign in to add a comment

Hosted by Google Code