This commit is contained in:
Andrea Cavalli 2022-06-22 19:23:18 +02:00
parent f4fcc7d6d6
commit ac5a26601e

View File

@ -1373,11 +1373,15 @@ public class SourcesGenerator {
return fieldName; return fieldName;
} }
); );
deserializeMethod.beginControlFlow("");
deserializeMethod.addStatement( deserializeMethod.addStatement(
"$$field$$" + (currentVarNumber.getInt(upgradeDataTransformation.from) + 1) + "$$" "$T upgraded = ($T) " + dataUpgraderFieldName + ".upgrade(($T) $$field$$"
+ upgradeDataTransformation.from + " = ($T) " + dataUpgraderFieldName + ".upgrade(($T) $$field$$"
+ currentVarNumber.getInt(upgradeDataTransformation.from) + "$$" + currentVarNumber.getInt(upgradeDataTransformation.from) + "$$"
+ upgradeDataTransformation.from + ")", toType, toTypeBoxed, fromTypeBoxed); + upgradeDataTransformation.from + ")", toType, toTypeBoxed, fromTypeBoxed);
deserializeMethod.addStatement(
"$$field$$" + (currentVarNumber.getInt(upgradeDataTransformation.from) + 1) + "$$"
+ upgradeDataTransformation.from + " = upgraded");
deserializeMethod.endControlFlow();
Objects.requireNonNull(currentTransformedFieldTypes.remove( Objects.requireNonNull(currentTransformedFieldTypes.remove(
upgradeDataTransformation.transformClass + "." + upgradeDataTransformation.from)); upgradeDataTransformation.transformClass + "." + upgradeDataTransformation.from));
currentTransformedFieldTypes.put( currentTransformedFieldTypes.put(