Don't look for instance fields on interfaces.

This commit is contained in:
Jesse Wilson 2011-08-04 23:53:10 +00:00
parent 1885ba7dec
commit e04d3fa882

View File

@ -166,6 +166,10 @@ public final class ReflectiveTypeAdapter<T> extends TypeAdapter<T> {
private Map<String, BoundField> getBoundFields(
MiniGson context, TypeToken<?> type, Class<?> raw) {
Map<String, BoundField> result = new LinkedHashMap<String, BoundField>();
if (raw.isInterface()) {
return result;
}
Type declaredType = type.getType();
while (raw != Object.class) {
Field[] fields = raw.getDeclaredFields();