From e2e672740a6e58f81924406decba024a239fb8a5 Mon Sep 17 00:00:00 2001 From: Jesse Wilson Date: Tue, 6 Dec 2011 15:29:48 +0000 Subject: [PATCH] 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. --- gson/src/main/java/com/google/gson/GsonBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gson/src/main/java/com/google/gson/GsonBuilder.java b/gson/src/main/java/com/google/gson/GsonBuilder.java index 82014be4..008a2d3f 100644 --- a/gson/src/main/java/com/google/gson/GsonBuilder.java +++ b/gson/src/main/java/com/google/gson/GsonBuilder.java @@ -541,9 +541,9 @@ public final class GsonBuilder { */ public Gson create() { List factories = new ArrayList(); - 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,