From e04d3fa882e7829fc2b1d174a28e4e3640306696 Mon Sep 17 00:00:00 2001 From: Jesse Wilson Date: Thu, 4 Aug 2011 23:53:10 +0000 Subject: [PATCH] Don't look for instance fields on interfaces. --- .../com/google/gson/internal/bind/ReflectiveTypeAdapter.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gson/src/main/java/com/google/gson/internal/bind/ReflectiveTypeAdapter.java b/gson/src/main/java/com/google/gson/internal/bind/ReflectiveTypeAdapter.java index 351ea4d9..a036b357 100644 --- a/gson/src/main/java/com/google/gson/internal/bind/ReflectiveTypeAdapter.java +++ b/gson/src/main/java/com/google/gson/internal/bind/ReflectiveTypeAdapter.java @@ -166,6 +166,10 @@ public final class ReflectiveTypeAdapter extends TypeAdapter { private Map getBoundFields( MiniGson context, TypeToken type, Class raw) { Map result = new LinkedHashMap(); + if (raw.isInterface()) { + return result; + } + Type declaredType = type.getType(); while (raw != Object.class) { Field[] fields = raw.getDeclaredFields();