Fix integration tests that fell out from some benchmarking.

This commit is contained in:
Jesse Wilson 2011-07-15 13:43:52 +00:00
parent 9cf579ef01
commit 3c4d121dc8
2 changed files with 2 additions and 1 deletions

View File

@ -56,10 +56,10 @@ public final class MiniGson {
factories.add(TypeAdapters.DOUBLE_FACTORY);
factories.add(TypeAdapters.LONG_FACTORY);
factories.add(TypeAdapters.STRING_FACTORY);
factories.add(ReflectiveTypeAdapter.FACTORY);
factories.add(CollectionTypeAdapter.FACTORY);
factories.add(StringToValueMapTypeAdapter.FACTORY);
factories.add(ArrayTypeAdapter.FACTORY);
factories.add(ReflectiveTypeAdapter.FACTORY);
this.factories = Collections.unmodifiableList(factories);
}

View File

@ -56,6 +56,7 @@ final class ReflectiveTypeAdapter<T> extends TypeAdapter<T> {
Map<String, BoundField<?>> result = new LinkedHashMap<String, BoundField<?>>();
while (raw != Object.class) {
for (Field field : raw.getDeclaredFields()) {
field.setAccessible(true); // TODO: don't call setAccessible unless necessary
Type fieldType = $Gson$Types.resolve(type.getType(), raw, field.getGenericType());
BoundField<?> boundField = BoundField.create(context, field, TypeToken.get(fieldType));
result.put(boundField.name, boundField);