Fix type checks with custom adapters.

Moshi.Builder.add(Type, ...) adds a factory that had a broken type equality check.
Closes #128
This commit is contained in:
Eric Cochran
2018-04-08 00:42:46 -07:00
committed by GitHub
parent 2cc878da81
commit fa1f10dc77

View File

@@ -45,7 +45,7 @@ public final class Util {
public static boolean typesMatch(Type pattern, Type candidate) { public static boolean typesMatch(Type pattern, Type candidate) {
// TODO: permit raw types (like Set.class) to match non-raw candidates (like Set<Long>). // TODO: permit raw types (like Set.class) to match non-raw candidates (like Set<Long>).
return pattern.equals(candidate); return Types.equals(pattern, candidate);
} }
public static Set<? extends Annotation> jsonAnnotations(AnnotatedElement annotatedElement) { public static Set<? extends Annotation> jsonAnnotations(AnnotatedElement annotatedElement) {