title: Fields not deserialized when instance creator is registered with gson
body: <p>I'm using <a href="https://github.com/google/gson" rel="nofollow">gson</a> to deserialize objects, and I'm telling gson the interface class rather than the implementation class of the object I want. I register an <code>InstanceCreator</code> that constructs an instance of the implementation class.</p>
  
  <p>This test demonstrates the problem that I encounter:</p>
  
  <pre><code>public class UnexpectedGsonBehaviorTest {
  
      public static interface Fruits {
          List&lt;String&gt; getFruitList();
      }
  
      public static class FruitsImpl implements Fruits {
  
          private List&lt;String&gt; fruitList;
  
          public List&lt;String&gt; getFruitList() {
              return fruitList;
          }
  
          public String toString() {
              return "FruitsImpl{" + "fruitList=" + fruitList + '}';
          }
  
      }
  
      @Test
      public void testUseCustomFruitsInstanceCreator() {
          Gson gson = new GsonBuilder()
            .registerTypeAdapter(Fruits.class, new InstanceCreator&lt;Fruits&gt;(){
              public Fruits createInstance(Type type) {
                  return new FruitsImpl();
              }
          }).create();
          String fruitsJson = "{\"fruitList\": [\"apples\", \"pears\", \"bananas\"]}";
          System.out.println("input: " + fruitsJson);
          Fruits fruits = gson.fromJson(fruitsJson, Fruits.class);
          System.out.println("output: " + fruits);
          assertNotNull("expect non-null fruit list", fruits.getFruitList());
      }
  
  }
  </code></pre>
  
  <p>I expect the list member of the <code>FruitsImpl</code> object to be deserialized, but it is not. The output is</p>
  
  <pre><code>input: {"fruitList": ["apples", "pears", "bananas"]}
  output: FruitsImpl{fruitList=null} 
  </code></pre>
  
  <p>and the assertion fails.</p>
  
  <p>If I just use a default gson instance and <code>gson.fromJson(fruitsJson, FruitsImpl.class)</code>, the list field is correctly deserialized. Am I using gson wrong, or is there some other issue?</p>