Source:
public void setList(String fieldName, RealmList<DynamicRealmObject> list) { if (list == null) { throw new IllegalArgumentException("Null values not allowed for lists"); } long columnIndex = proxyState.getRow$realm().getColumnIndex(fieldName); LinkView links = proxyState.getRow$realm().getLinkList(columnIndex); Table linkTargetTable = links.getTargetTable(); final String linkTargetTableName = Table.tableNameToClassName(linkTargetTable.getName()); boolean typeValidated; if (list.className == null && list.clazz == null) { typeValidated = false; } else { String listType = list.className != null ? list.className : Table.tableNameToClassName(proxyState.getRealm$realm().schema.getTable(list.clazz).getName()); if (!linkTargetTableName.equals(listType)) { throw new IllegalArgumentException(String.format(Locale.ENGLISH, "The elements in the list is not the proper type. " + "Was %s expected %s.", listType, linkTargetTableName)); } typeValidated = true; } final int listLength = list.size(); final long[] indices = new long[listLength]; for (int i = 0; i < listLength; i++) { RealmObjectProxy obj = list.get(i); if (obj.realmGet$proxyState().getRealm$realm() != proxyState.getRealm$realm()) { throw new IllegalArgumentException("Each element in 'list' must belong to the same Realm instance."); } if (!typeValidated && !linkTargetTable.hasSameSchema(obj.realmGet$proxyState().getRow$realm().getTable())) { throw new IllegalArgumentException(String.format(Locale.ENGLISH, "Element at index %d is not the proper type. " + "Was '%s' expected '%s'.", i, Table.tableNameToClassName(obj.realmGet$proxyState().getRow$realm().getTable().getName()), linkTargetTableName)); } indices[i] = obj.realmGet$proxyState().getRow$realm().getIndex(); } links.clear(); for (int i = 0; i < listLength; i++) { links.add(indices[i]); } }

Target:
public void setList(String fieldName, RealmList<DynamicRealmObject> list) { if (list == null) { throw new IllegalArgumentException("Null values not allowed for lists"); } long columnIndex = proxyState.getRow$realm().getColumnIndex(fieldName); LinkView links = proxyState.getRow$realm().getLinkList(columnIndex); Table linkTargetTable = links.getTargetTable(); final String linkTargetTableName = Table.tableNameToClassName(linkTargetTable.getName()); boolean typeValidated; if (list.className == null && list.clazz == null) { typeValidated = false; } else { String listType = list.className != null ? list.className : Table.tableNameToClassName(proxyState.getRealm$realm().schema.getTable(list.clazz).getName()); if (!linkTargetTableName.equals(listType)) { throw new IllegalArgumentException(String.format(Locale.ENGLISH, "The elements in the list are not the proper type. " + "Was %s expected %s.", listType, linkTargetTableName)); } typeValidated = true; } final int listLength = list.size(); final long[] indices = new long[listLength]; for (int i = 0; i < listLength; i++) { RealmObjectProxy obj = list.get(i); if (obj.realmGet$proxyState().getRealm$realm() != proxyState.getRealm$realm()) { throw new IllegalArgumentException("Each element in 'list' must belong to the same Realm instance."); } if (!typeValidated && !linkTargetTable.hasSameSchema(obj.realmGet$proxyState().getRow$realm().getTable())) { throw new IllegalArgumentException(String.format(Locale.ENGLISH, "Element at index %d is not the proper type. " + "Was '%s' expected '%s'.", i, Table.tableNameToClassName(obj.realmGet$proxyState().getRow$realm().getTable().getName()), linkTargetTableName)); } indices[i] = obj.realmGet$proxyState().getRow$realm().getIndex(); } links.clear(); for (int i = 0; i < listLength; i++) { links.add(indices[i]); } }