Browse Source

Pull request #2709: REPORT-41299 新建错误数据集无法删除-转meiao

Merge in DESIGN/design from ~YVAN/design:bugfix/10.0 to bugfix/10.0

* commit 'bd431d964138d2ec398a21f30be3857b40737330':
  REPORT-41299 新建错误数据集无法删除-转meiao 【问题原因】如果建立了错误的数据集,并将数据集展开查看列名时,删除其中一个会造成cTreeNode.getFirstChild()产生异常,从而不能更新界面,看起来就是删除不掉 【改动思路】增加判断cTreeNode是否是错误数据集并处于展开状态,如果是的,将展开状态置为不展开,并break跳过后面检查子节点的逻辑,避免异常
bugfix/10.0
Yvan 4 years ago
parent
commit
5676ed1d1a
  1. 7
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java

7
designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java

@ -113,6 +113,11 @@ public class TableDataTree extends UserObjectRefreshJTree<TableDataSourceOP> {
break; break;
} }
new_nodes[ci].setExpanded(cTreeNode.isExpanded()); new_nodes[ci].setExpanded(cTreeNode.isExpanded());
// REPORT-41299 如果建立的是错误的数据集(没有Child的情况)且这个错误数据集处于isExpanded状态,会在后面的if语句中调用getFirstChild()产生异常,因此这里判断一下
if (cTreeNode.isExpanded() && cTreeNode.getChildCount() == 0) {
new_nodes[ci].setExpanded(false);
break;
}
if (cTreeNode.getFirstChild() instanceof ExpandMutableTreeNode && cTreeNode.isExpanded()) { if (cTreeNode.getFirstChild() instanceof ExpandMutableTreeNode && cTreeNode.isExpanded()) {
checkChildNodes(cTreeNode, new_nodes[ci]); checkChildNodes(cTreeNode, new_nodes[ci]);
} }
@ -242,4 +247,4 @@ public class TableDataTree extends UserObjectRefreshJTree<TableDataSourceOP> {
treeModel.reload(root); treeModel.reload(root);
} }
} }

Loading…
Cancel
Save