From abfcbe289d726410465d0e3832282f217919394a Mon Sep 17 00:00:00 2001 From: yanglin Date: Wed, 19 Mar 2025 16:22:25 +0800 Subject: [PATCH] =?UTF-8?q?REQ-3540:=20=E8=AE=B0=E5=BD=95=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/axzo/nanopart/doc/file/index/IndexManager.java | 2 +- .../nanopart/doc/file/index/copy/ConnectNodeVisitor.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/doc-server/src/main/java/cn/axzo/nanopart/doc/file/index/IndexManager.java b/doc/doc-server/src/main/java/cn/axzo/nanopart/doc/file/index/IndexManager.java index bcae5ac1..e3c1a5db 100644 --- a/doc/doc-server/src/main/java/cn/axzo/nanopart/doc/file/index/IndexManager.java +++ b/doc/doc-server/src/main/java/cn/axzo/nanopart/doc/file/index/IndexManager.java @@ -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). asValueNode().getValue(); + IndexNode rootNode = connectRoot.getChildren().get(0).tryGetValue(); // resolve the name issue if (!rootNode.isChildrenNameDuplicatable()) indexSupport.incrNameIfDuplicate(rootNode); diff --git a/doc/doc-server/src/main/java/cn/axzo/nanopart/doc/file/index/copy/ConnectNodeVisitor.java b/doc/doc-server/src/main/java/cn/axzo/nanopart/doc/file/index/copy/ConnectNodeVisitor.java index 1f932cfb..7f69aa6d 100644 --- a/doc/doc-server/src/main/java/cn/axzo/nanopart/doc/file/index/copy/ConnectNodeVisitor.java +++ b/doc/doc-server/src/main/java/cn/axzo/nanopart/doc/file/index/copy/ConnectNodeVisitor.java @@ -29,10 +29,10 @@ public class ConnectNodeVisitor extends ValueNodeRecursiveVisitor { copy.setRootCode(destParentNode == null ? copiedRoot.getCode() : destParentNode.getRootCode()); copy.setParentId(node.getParent().isTreeRoot() ? destParentNode == null ? IndexNode.TREE_ROOT_NODE_ID : destParentNode.getId() - : node.getParent(). asValueNode().getValue().getId()); + : node.getParent(). tryGetValue().getId()); copy.setParentCode(node.getParent().isTreeRoot() // ? destParentNode == null ? IndexNode.TREE_ROOT_NOE_CODE : destParentNode.getCode() - : node.getParent(). asValueNode().getValue().getCode()); + : node.getParent(). tryGetValue().getCode()); copy.setPath(buildPathFor(node).toString()); return WalkingDecision.CONTINUE; } @@ -41,7 +41,7 @@ public class ConnectNodeVisitor extends ValueNodeRecursiveVisitor { 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: