REQ-3540: misc

This commit is contained in:
yanglin 2025-03-21 18:13:38 +08:00
parent bd40d4c229
commit ff64fc1519
2 changed files with 6 additions and 6 deletions

View File

@ -125,7 +125,7 @@ public class IndexManager {
}
private void ensureChildNameNotUsed(NodeCreate create, IndexNodeType nodeType, boolean withLock) {
if (indexSupport.isChildrenNameDuplicatable(create))
if (indexSupport.childrenNameDuplicatable(create))
return;
if (withLock)
indexSupport.lockParentAndReleaseOnCommit(create);
@ -138,7 +138,7 @@ public class IndexManager {
if (indexNode.getName().equals(newName))
return;
docLogDao.log("indexNode:rename", code, "newName", newName);
if (!indexSupport.isChildrenNameDuplicatable(indexNode)) {
if (!indexSupport.childrenNameDuplicatable(indexNode)) {
indexSupport.lockParentAndReleaseOnCommit(indexNode);
indexSupport.ensureChildNameNotUsed(indexNode, indexNode.getNodeType(), newName);
}
@ -228,7 +228,7 @@ public class IndexManager {
indexNodeDao.connectNodes(TreeUtils.collectValues(connectRoot));
IndexNode rootNode = connectRoot.getChildren().get(0).tryGetValue();
// resolve the name issue
if (!indexSupport.isChildrenNameDuplicatable(rootNode))
if (!indexSupport.childrenNameDuplicatable(rootNode))
indexSupport.incrNameIfDuplicate(rootNode);
// get the coped root with full props
return indexNodeDao.findOrNull(rootNode.getCode());

View File

@ -96,7 +96,7 @@ public class IndexSupport {
BizAssertions.assertTrue(
indexNodeDao.validChildrenCount(parent.getCode()) < docProps.getIndexNodeMaxChildrenSize(),
"创建失败, 子节点数量不能超过 {}", docProps.getIndexNodeMaxChildrenSize());
if (!parent.isRoot() && isLimitChildrenCount(child))
if (!parent.isRoot() && limitChildrenCount(child))
BizAssertions.assertTrue(parent.path().depth() < docProps.getIndexNodeMaxDepth(), //
"节点深度超过限制{}, 无法再创建新节点", docProps.getIndexNodeMaxDepth());
}
@ -164,7 +164,7 @@ public class IndexSupport {
.list();
}
boolean isChildrenNameDuplicatable(IndexNodeParentScope parentScope) {
boolean childrenNameDuplicatable(IndexNodeParentScope parentScope) {
IndexNodeScope nodeScope = parentScope.nodeScope();
switch (nodeScope.context()) {
case FILE_TEMPLATE:
@ -175,7 +175,7 @@ public class IndexSupport {
}
}
boolean isLimitChildrenCount(IndexNodeParentScope parentScope) {
boolean limitChildrenCount(IndexNodeParentScope parentScope) {
IndexNodeScope nodeScope = parentScope.nodeScope();
switch (nodeScope.context()) {
case FILE_TEMPLATE: