提交 a1346ec0 编写于 作者: N Nikita Akilov

#11300 fix stack overflow error in data transfer dialog

上级 f6f69ce5
......@@ -74,6 +74,7 @@ public class DatabaseConsumerPageMapping extends ActiveWizardPage<DataTransferWi
private TreeViewer mappingViewer;
private Button autoAssignButton;
private ObjectContainerSelectorPanel containerPanel;
private boolean autoAssignedOnFirstActivation = false;
private static abstract class MappingLabelProvider extends CellLabelProvider {
@Override
......@@ -975,6 +976,10 @@ public class DatabaseConsumerPageMapping extends ActiveWizardPage<DataTransferWi
}
}
loadAndUpdateColumnsModel();
if (!autoAssignedOnFirstActivation) {
autoAssignedOnFirstActivation = true;
autoAssignMappings();
}
updatePageCompletion();
}
......@@ -982,9 +987,7 @@ public class DatabaseConsumerPageMapping extends ActiveWizardPage<DataTransferWi
// Load columns model. Update it only if mapping have different set of source columns
// Otherwise we keep current mappings (to allow wizard page navigation without loosing mappings)
DatabaseConsumerSettings settings = getDatabaseConsumerSettings();
boolean newMappings = false;
List<DatabaseMappingContainer> model = new ArrayList<>();
for (DataTransferPipe pipe : getWizard().getSettings().getDataPipes()) {
if (pipe.getProducer() == null || !(pipe.getProducer().getDatabaseObject() instanceof DBSDataContainer)) {
continue;
......@@ -1014,7 +1017,6 @@ public class DatabaseConsumerPageMapping extends ActiveWizardPage<DataTransferWi
settings.addDataMappings(getWizard().getRunnableContext(), sourceDataContainer, mapping);
}
model.add(mapping);
newMappings = mapping.getMappingType() == DatabaseMappingType.unspecified;
}
mappingViewer.setInput(model);
......@@ -1023,10 +1025,6 @@ public class DatabaseConsumerPageMapping extends ActiveWizardPage<DataTransferWi
mappingViewer.setSelection(new StructuredSelection(model.get(0)));
}
if (newMappings) {
autoAssignMappings();
}
Tree table = mappingViewer.getTree();
int totalWidth = table.getClientArea().width;
TreeColumn[] columns = table.getColumns();
......@@ -1057,4 +1055,4 @@ public class DatabaseConsumerPageMapping extends ActiveWizardPage<DataTransferWi
super.updatePageCompletion();
updateAutoAssign();
}
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册