return copyOf(((boolean[]) array)); return copyOf(((byte[]) array)); return copyOf(((char[]) array)); return copyOf(((double[]) array)); return copyOf(((float[]) array)); return copyOf(((int[]) array)); return copyOf(((long[]) array)); return copyOf(((short[]) array)); Array.set(copy, i, copyOf(Array.get(array, i)));
/** * Copies all values of property {@code Value} deeply. * * @param source * The source to copy from. * @param target * The target to copy {@code source} to. * @throws NullPointerException * if {@code target} is {@code null}. */ @SuppressWarnings("unchecked") private static void copyValue(final List<Object> source, final List<Object> target) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 if ((source!= null)&&(!source.isEmpty())) { for (final Iterator<?> it = source.iterator(); it.hasNext(); ) { final Object next = it.next(); if (next instanceof Object) { // CBuiltinLeafInfo: java.lang.Object target.add(copyOf(((Object) next))); continue; } // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Value' of class 'com.evolveum.midpoint.xml.ns._public.model.scripting_3.ValueListType'.")); } } }
/** * Creates and returns a deep copy of a given {@code JAXBElement} instance. * * @param element * The instance to copy or {@code null}. * @return * A deep copy of {@code element} or {@code null} if {@code element} is {@code null}. */ @SuppressWarnings("unchecked") private static JAXBElement copyOf(final JAXBElement element) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 if (element!= null) { final JAXBElement copy = new JAXBElement(element.getName(), element.getDeclaredType(), element.getScope(), element.getValue()); copy.setNil(element.isNil()); copy.setValue(copyOf(copy.getValue())); return copy; } return null; }