diff --git a/gson/src/main/java/com/google/gson/internal/bind/ReflectiveTypeAdapterFactory.java b/gson/src/main/java/com/google/gson/internal/bind/ReflectiveTypeAdapterFactory.java index 1687889b19..95d01acebf 100644 --- a/gson/src/main/java/com/google/gson/internal/bind/ReflectiveTypeAdapterFactory.java +++ b/gson/src/main/java/com/google/gson/internal/bind/ReflectiveTypeAdapterFactory.java @@ -68,11 +68,7 @@ public ReflectiveTypeAdapterFactory(ConstructorConstructor constructorConstructo this.reflectionFilters = reflectionFilters; } - public boolean excludeField(Field f, boolean serialize) { - return excludeField(f, serialize, excluder); - } - - static boolean excludeField(Field f, boolean serialize, Excluder excluder) { + private boolean includeField(Field f, boolean serialize) { return !excluder.excludeClass(f.getType(), serialize) && !excluder.excludeField(f, serialize); } @@ -196,8 +192,8 @@ private Map getBoundFields(Gson context, TypeToken type, } for (Field field : fields) { - boolean serialize = excludeField(field, true); - boolean deserialize = excludeField(field, false); + boolean serialize = includeField(field, true); + boolean deserialize = includeField(field, false); if (!serialize && !deserialize) { continue; }