Fix polymorphic bug
This commit is contained in:
parent
424c3f1c45
commit
379326fd63
@ -44,7 +44,7 @@ public abstract class MoshiPolymorphic<OBJ> {
|
|||||||
private synchronized void initialize() {
|
private synchronized void initialize() {
|
||||||
if (!this.initialized) {
|
if (!this.initialized) {
|
||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
var abstractMoshiBuilder = new Moshi.Builder().add(new RecordsJsonAdapterFactory());
|
var abstractMoshiBuilder = new Moshi.Builder();
|
||||||
var abstractClasses = getAbstractClasses();
|
var abstractClasses = getAbstractClasses();
|
||||||
var concreteClasses = getConcreteClasses();
|
var concreteClasses = getConcreteClasses();
|
||||||
var extraAdapters = getExtraAdapters();
|
var extraAdapters = getExtraAdapters();
|
||||||
@ -67,6 +67,8 @@ public abstract class MoshiPolymorphic<OBJ> {
|
|||||||
|
|
||||||
extraAdapters.forEach(abstractMoshiBuilder::add);
|
extraAdapters.forEach(abstractMoshiBuilder::add);
|
||||||
|
|
||||||
|
abstractMoshiBuilder.add(new RecordsJsonAdapterFactory());
|
||||||
|
|
||||||
abstractMoshi = abstractMoshiBuilder.build();
|
abstractMoshi = abstractMoshiBuilder.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user