修复JsonConvert没有按指定Type进行convertTo的BUG

This commit is contained in:
Redkale
2018-07-12 17:45:41 +08:00
parent 7b81c42377
commit 1c88fb0355

View File

@@ -136,7 +136,7 @@ public final class ObjectEncoder<W extends Writer, T> implements Encodeable<W, T
}
}
}
if (value.getClass() != this.typeClass) {
if (factory.isReversible() && value.getClass() != this.typeClass) {
final Class clz = value.getClass();
if (out.needWriteClassName()) out.writeClassName(factory.getEntityAlias(clz));
factory.loadEncoder(clz).convertTo(out, value);