Gson should only ever call this method when we're expecting it to; * that is only when we've called back into Gson to deserialize a tree. */ + @SuppressWarnings("unchecked") public Object createInstance(Type type) { Graph graph = graphThreadLocal.get(); if (graph == null || graph.nextCreate == null) { diff --git a/gson/src/test/java/com/google/gson/functional/CustomTypeAdaptersTest.java b/gson/src/test/java/com/google/gson/functional/CustomTypeAdaptersTest.java index ea7b0cd4..93ec7858 100644 --- a/gson/src/test/java/com/google/gson/functional/CustomTypeAdaptersTest.java +++ b/gson/src/test/java/com/google/gson/functional/CustomTypeAdaptersTest.java @@ -216,6 +216,7 @@ public class CustomTypeAdaptersTest extends TestCase { assertEquals("true", gson.toJson(true, Boolean.class)); } + @SuppressWarnings("rawtypes") public void testCustomDeserializerInvokedForPrimitives() { Gson gson = new GsonBuilder() .registerTypeAdapter(boolean.class, new JsonDeserializer() {