@SuppressWarnings("unchecked") private <T> T cloneArray(T o, Map<Object, Object> clones) throws IllegalAccessException { final Class<T> clz = (Class<T>) o.getClass(); final int length = Array.getLength(o); final T newInstance = (T) Array.newInstance(clz.getComponentType(), length); if (clones != null) { clones.put(o, newInstance); } if (clz.getComponentType().isPrimitive() || isImmutable(clz.getComponentType())) { System.arraycopy(o, 0, newInstance, 0, length); } else { for (int i = 0; i < length; i++) { final Object v = Array.get(o, i); final Object clone = clones != null ? cloneInternal(v, clones) : v; Array.set(newInstance, i, clone); } } return newInstance; }
@SuppressWarnings("unchecked") private <T> T cloneArray(T o, Map<Object, Object> clones) throws IllegalAccessException { final Class<T> clz = (Class<T>) o.getClass(); final int length = Array.getLength(o); final T newInstance = (T) Array.newInstance(clz.getComponentType(), length); if (clones != null) { clones.put(o, newInstance); } if (clz.getComponentType().isPrimitive() || isImmutable(clz.getComponentType())) { System.arraycopy(o, 0, newInstance, 0, length); } else { for (int i = 0; i < length; i++) { final Object v = Array.get(o, i); final Object clone = clones != null ? cloneInternal(v, clones) : v; Array.set(newInstance, i, clone); } } return newInstance; }
if (iClz.isAssignableFrom(clz)) return o; if (isImmutable(clz)) return o; if (o instanceof IFreezable) { final IFreezable f = (IFreezable) o;
if (iClz.isAssignableFrom(clz)) return o; if (isImmutable(clz)) return o; if (o instanceof IFreezable) { final IFreezable f = (IFreezable) o;