private void setChanges( Instance dest, Instance src, Function<Instance, Instance> oldFunction, long[] changes, boolean isInput) { AModelType type = InvocationContext.get().getTypeManager().getByPrefix(dest._type()); List<AIField> fields = type.getAllFields(); for (AIField f : fields) { if (f.getName().equals("id")) { dest._setId(src.getId()); continue; } // If this field changed int index = dest._getPropertyIndex(f.getName()); if (InstanceImpl._hasBit(changes, index)) { if (f.isChild()) { setChildValue(dest, src, f, oldFunction, isInput); } else { Property<?> property = src._get(f.getName()); if (property == null) { continue; } dest._set(f.getName(), property.getValue()); } dest._markChange(index, null, null); } } }