REQ-3540: 记录日志

This commit is contained in:
yanglin 2025-03-19 16:22:25 +08:00
parent b7bfaba672
commit abfcbe289d
2 changed files with 4 additions and 4 deletions

View File

@ -212,7 +212,7 @@ public class IndexManager {
// rebuild parent id, parent code and the most important path
connectRoot.walkDown(new ConnectNodeVisitor(destParent));
indexNodeDao.connectNodes(TreeUtils.collectValues(connectRoot));
IndexNode rootNode = connectRoot.getChildren().get(0).<IndexNode> asValueNode().getValue();
IndexNode rootNode = connectRoot.getChildren().get(0).tryGetValue();
// resolve the name issue
if (!rootNode.isChildrenNameDuplicatable())
indexSupport.incrNameIfDuplicate(rootNode);

View File

@ -29,10 +29,10 @@ public class ConnectNodeVisitor extends ValueNodeRecursiveVisitor<IndexNode> {
copy.setRootCode(destParentNode == null ? copiedRoot.getCode() : destParentNode.getRootCode());
copy.setParentId(node.getParent().isTreeRoot()
? destParentNode == null ? IndexNode.TREE_ROOT_NODE_ID : destParentNode.getId()
: node.getParent().<IndexNode> asValueNode().getValue().getId());
: node.getParent().<IndexNode> tryGetValue().getId());
copy.setParentCode(node.getParent().isTreeRoot() //
? destParentNode == null ? IndexNode.TREE_ROOT_NOE_CODE : destParentNode.getCode()
: node.getParent().<IndexNode> asValueNode().getValue().getCode());
: node.getParent().<IndexNode> tryGetValue().getCode());
copy.setPath(buildPathFor(node).toString());
return WalkingDecision.CONTINUE;
}
@ -41,7 +41,7 @@ public class ConnectNodeVisitor extends ValueNodeRecursiveVisitor<IndexNode> {
Path path = Path.empty();
for (Node current = node; current != null; current = current.getParent()) {
if (!current.isTreeRoot()) {
path = path.append(current.asValueNode().getValue().stringId());
path = path.append(current.tryGetValue().stringId());
continue;
}
// IMPORTANT: append REVERSED parent path but not parent id, because: