mirror of
https://github.com/fankes/moshi.git
synced 2025-10-19 16:09:21 +08:00
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:
@@ -45,7 +45,7 @@ public final class Util {
|
||||
|
||||
public static boolean typesMatch(Type pattern, Type candidate) {
|
||||
// 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) {
|
||||
|
Reference in New Issue
Block a user