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:
parent
b19e187bdd
commit
e2e672740a
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user