}
} else {
toRemove = fieldInfo;
}
if (toRemove == null) {
final ObjectAndPersistInfo fieldValue = defaultValue(fieldInfo
.getFieldTypeInfo());
convertedValuedFieldList.addNewFieldAndItsValue(fieldInfo,
fieldValue);
} else {
// remove needed to replace the key
convertedValuedFieldList.removeFieldInfo(toRemove);
if (index != null) {
convertedValuedFieldList.addFieldInfo(index, fieldInfo);
final ObjectAndPersistInfo objectAndPersistInfo = convertedValuedFieldList
.getFieldValue(index);
// ASSERTX
assert assertFieldValue(fieldInfo, objectAndPersistInfo);
if (objectAndPersistInfo.getObject() != null
&& !fieldInfo.isBasicOrPrimitiveType()
&& !fieldInfo
.getFieldTypeInfo()
.isAssignableFrom(
objectAndPersistInfo.objectClassInfo)) {
final ObjectAndPersistInfo fieldValue = createDummyValueObject(
fieldInfo.getFieldTypeInfo(),
objectAndPersistInfo.dataRecordIdentifier);
convertedValuedFieldList.setFieldValue(index,
fieldValue);
}