This commit is contained in:
地平线
2015-06-19 08:54:08 +08:00
parent f7a02eaa10
commit 323c78e46b

View File

@@ -8,8 +8,8 @@ package com.wentch.redkale.convert;
import java.lang.reflect.*;
/**
* 对象数组的反序列化不包含int[]、long[]这样的primitive class数组.
* 数组长度不能超过 32767。 在BSON中数组长度设定的是short对于大于32767长度的数组传输会影响性能所以没有采用int存储。
* 对象数组的反序列化不包含int[]、long[]这样的primitive class数组.
* 数组长度不能超过 32767。 在BSON中数组长度设定的是short对于大于32767长度的数组传输会影响性能所以没有采用int存储。
* 支持一定程度的泛型。
*
* @author zhangjx
@@ -57,7 +57,7 @@ public final class ArrayEncoder<T> implements Encodeable<Writer, T[]> {
boolean first = true;
for (Object v : value) {
if (!first) out.writeArrayMark();
((v.getClass() == comp) ? encoder : anyEncoder).convertTo(out, v);
((v != null && v.getClass() == comp) ? encoder : anyEncoder).convertTo(out, v);
if (first) first = false;
}
out.writeArrayE();