title: deserializing generics with gson
body: <p>I am using GSON 1.4 and serializing an object with two generic <code>arraylist&lt;myObject&gt;</code> as follows 
  <code>String data = Gson.toJson(object, object.class)</code>. When I desirialize it I do <code>gson.fromJson(json, type);</code></p>
  
  <p>sadly I get </p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: Can not set java.util.ArrayList
    field ... to java.util.LinkedList</p>
  </blockquote>
  
  <p>Why is that ? GSON doc notes that if I serialize with object.class parameter it supports generics. any idea? thanks.</p>
  
  <p>my class is :</p>
  
  <pre><code>public class IndicesAndWeightsParams {
  
      public List&lt;IndexParams&gt; indicesParams;
      public List&lt;WeightParams&gt; weightsParams;
  
      public IndicesAndWeightsParams() {
          indicesParams = new ArrayList&lt;IndexParams&gt;();
          weightsParams = new ArrayList&lt;WeightParams&gt;();
      }
      public IndicesAndWeightsParams(ArrayList&lt;IndexParams&gt; indicesParams, ArrayList&lt;WeightParams&gt; weightsParams) {
          this.indicesParams = indicesParams;
          this.weightsParams = weightsParams;
      }
  }    
  public class IndexParams {
  
      public IndexParams() {
      }
      public IndexParams(String key, float value, String name) {
        this.key = key;
        this.value = value;
        this.name = name;
      }
      public String key;
      public float value;
      public String name;
  }
  </code></pre>