Fix broken test in registering competing type hierarchy adapters.

I actually tried to replicate this test but got an error "type adapters conflict" when I was doing it. I suspect the problem was that I was trying to use 'Object' as the base of my type hierarchy and that class is somehow special.
This commit is contained in:
Jesse Wilson 2011-12-06 15:29:48 +00:00
parent b19e187bdd
commit e2e672740a

View File

@ -541,9 +541,9 @@ public final class GsonBuilder {
*/
public Gson create() {
List<TypeAdapter.Factory> factories = new ArrayList<TypeAdapter.Factory>();
factories.addAll(this.hierarchyFactories);
factories.addAll(this.factories);
Collections.reverse(factories);
factories.addAll(this.hierarchyFactories);
addTypeAdaptersForDate(datePattern, dateStyle, timeStyle, factories);
return new Gson(excluder, fieldNamingPolicy, instanceCreators,