}
if (isLegacyDefaultDataFactory(originalDataFactory))
{
final CompoundDataFactory compoundDataFactory = CompoundDataFactory.normalize(dataFactory);
DefaultDataFactoryChangeRecorder.applyChanges(compoundDataFactory, dataFactoryChanges);
report.setDataFactory(compoundDataFactory);
activeContext.getUndo().addChange(ActionMessages.getString("AddDataFactoryAction.UndoText"),
new DataSourceEditUndoEntry(0, null, dataFactory.derive()));
}
else
{
final CompoundDataFactory reportDf = CompoundDataFactory.normalize(originalDataFactory);
DefaultDataFactoryChangeRecorder.applyChanges(reportDf, dataFactoryChanges);
final int position = reportDf.size();
reportDf.add(dataFactory);
activeContext.getUndo().addChange(ActionMessages.getString("AddDataFactoryAction.UndoText"),
new DataSourceEditUndoEntry(position, null, dataFactory.derive()));
report.setDataFactory(reportDf);
}
}