if (ClassInfo.NULL.equals(converterClass)) {
converterClass = conversionDefEntry.getConverterClass();
} else if (!ClassInfo.NULL.equals(conversionDefEntry
.getConverterClass())) {
throw new ConversionException("can not change converter class "
+ converterClass + " to "
+ conversionDefEntry.getConverterClass() + FOR
+ conversionDefEntry);
}
if (ClassInfo.NULL.equals(staticConverterClass)) {
staticConverterClass = conversionDefEntry.getStaticConverterClass();
} else if (ClassInfo.NULL.equals(conversionDefEntry
.getStaticConverterClass())) {
throw new ConversionException(
"can not change static converter class "
+ staticConverterClass + " to "
+ conversionDefEntry.getStaticConverterClass()
+ FOR + conversionDefEntry);
}
if (ClassInfo.NULL.equals(replacementClass)) {
replacementClass = newReplacementClass;
} else if (!ClassInfo.NULL.equals(newReplacementClass)
&& !replacementClass.equals(newReplacementClass)) {
throw new ConversionException("replacement class missmatch was "
+ replacementClass + " and update with "
+ newReplacementClass + FOR + conversionDefEntry);
}
if (conversionDefEntry.isFieldReplacementDef()) {
final FieldInfo originalFieldInfo = conversionDefEntry
.getOriginalFieldInfo();
final FieldInfo replacementFieldInfo = conversionDefEntry
.getReplacementFieldInfo();
try {
// ASSERTX
assert assertPerisstenceType(originalFieldInfo,
replacementFieldInfo);
if (originalFieldInfo.isStaticField()) {
staticFieldConversionMap.add(originalFieldInfo,
conversionDefEntry.getOriginalFieldIndex(),
replacementFieldInfo,
conversionDefEntry.getReplacementFieldIndex());
} else {
fieldConversionMap.add(originalFieldInfo,
conversionDefEntry.getOriginalFieldIndex(),
replacementFieldInfo,
conversionDefEntry.getReplacementFieldIndex());
}
} catch (ClassInfoException exception) {
throw new ConversionException("for\n" + conversionDefEntry,
exception);
}
}
if (fieldList.isEmpty()) {
fieldList = conversionDefEntry.getFieldList();
// ASSERTX
assert fieldList != null : "field list can not be null, for\n"
+ conversionDefEntry;
} else if (!conversionDefEntry.getFieldList().isEmpty()) {
throw new ConversionException("duplicate field list definition, "
+ fieldList + ", and " + conversionDefEntry.getFieldList()
+ FOR + conversionDefEntry);
}
}