/* */ public ArrayValue createArrayValue(ArrayMetaType type, Object value, Map<Object, MetaValue> mapping)
/* */ {
/* 299 */ if (value == null) {
/* 300 */ return null;
/* */ }
/* 302 */ ArrayValueSupport result = new ArrayValueSupport(type);
/* 303 */ mapping.put(value, result);
/* */
/* 307 */ MetaType elementType = type.getElementType();
/* 308 */ int dimension = type.getDimension();
/* */ Class componentType;
/* */ try {
/* 314 */ componentType = Class.forName(type.getClassName());
/* */ }
/* */ catch (Exception e)
/* */ {
/* 318 */ throw new RuntimeException("Unable to determine component type for " + type, e);
/* */ }
/* */
/* 321 */ ClassInfo classInfo = configuration.getClassInfo(value.getClass());
/* */ Object[] oldArray;
/* 322 */ if (classInfo.isArray())
/* */ {
/* 325 */ ArrayInfo arrayInfo = (ArrayInfo)ArrayInfo.class.cast(classInfo);
/* 326 */ TypeInfo compInfo = arrayInfo.getComponentType();
/* 327 */ while ((compInfo instanceof ArrayInfo))
/* */ {
/* 329 */ arrayInfo = (ArrayInfo)ArrayInfo.class.cast(compInfo);
/* 330 */ compInfo = arrayInfo.getComponentType();
/* */ }
/* */ Object[] oldArray;
/* 333 */ if (compInfo.isPrimitive())
/* 334 */ oldArray = convertPrimativeArray(classInfo, value);
/* */ else
/* 336 */ oldArray = (Object[])(Object[])value;
/* */ }
/* */ else {
/* 339 */ throw new UnsupportedOperationException("Cannot construct array for " + value.getClass());
/* */ }
/* */ Object[] oldArray;
/* 341 */ Object[] array = createArray(elementType, componentType.getComponentType(), dimension, oldArray);
/* 342 */ result.setValue(array);
/* 343 */ return result;
/* */ }