}
}
private ArrayValueCommand makeArray(Class<?> type, Object value)
throws SerializationException {
ArrayValueCommand toReturn = new ArrayValueCommand(type.getComponentType());
for (int i = 0, j = Array.getLength(value); i < j; i++) {
Object arrayValue = Array.get(value, i);
if (arrayValue == null) {
toReturn.add(NullValueCommand.INSTANCE);
} else {
Class<? extends Object> valueType = type.getComponentType().isPrimitive()
? type.getComponentType() : arrayValue.getClass();
toReturn.add(makeValue(valueType, arrayValue));
}
}
identityMap.put(value, toReturn);
return toReturn;
}