Browse Source

Merge remote-tracking branch 'origin/release/11.0' into release/11.0

newui
Link.Zhao 2 years ago
parent
commit
823fa78603
  1. 4
      designer-base/src/main/java/com/fr/design/carton/CartonThreadExecutorPool.java
  2. 26
      designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java
  3. 3
      designer-base/src/main/java/com/fr/design/carton/SwitchForSwingChecker.java
  4. 42
      designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java
  5. 19
      designer-base/src/main/java/com/fr/design/file/FileOperationHelper.java
  6. 1
      designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java
  7. 7
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java
  8. 19
      designer-base/src/main/java/com/fr/design/mainframe/manager/search/TemplateTreeSearchManager.java
  9. 6
      designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/common/TemplateDirSearchCallBack.java
  10. 6
      designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/common/TemplateSearchCallBack.java
  11. 3
      designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/common/TemplateSearchTask.java
  12. 4
      designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pre/TemplatePreSearchCallBack.java
  13. 2
      designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pre/TemplatePreSearchTask.java

4
designer-base/src/main/java/com/fr/design/carton/CartonThreadExecutorPool.java

@ -65,7 +65,7 @@ public class CartonThreadExecutorPool extends ThreadPoolExecutor {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put(Toolkit.i18nText("Fine-Design_Basic_Carton_Output_Time"), simpleDateFormatThreadSafe.format(System.currentTimeMillis())); jsonObject.put(Toolkit.i18nText("Fine-Design_Basic_Carton_Output_Time"), simpleDateFormatThreadSafe.format(System.currentTimeMillis()));
jsonObject.put(Toolkit.i18nText("Fine-Design_Basic_Carton_Event_Number"), "swingWorker_" + hangNumber); jsonObject.put(Toolkit.i18nText("Fine-Design_Basic_Carton_Event_Number"), "swingWorker_" + hangNumber);
jsonObject.put(Toolkit.i18nText("Fine-Design_Basic_Carton_Duration_Task_Execute"), timeSoFar()); jsonObject.put(Toolkit.i18nText("Fine-Design_Basic_Carton_Duration_Task_Execute"), timeSoFar() + "ms");
jsonObject.put(Toolkit.i18nText("Fine-Design_Basic_Carton_Stack_Info"), stackTrace); jsonObject.put(Toolkit.i18nText("Fine-Design_Basic_Carton_Stack_Info"), stackTrace);
EventDispatchThreadHangMonitor.outPutJournalLog(jsonObject.toString(), SwitchForSwingChecker.TIMER_CHECK_FLAG); EventDispatchThreadHangMonitor.outPutJournalLog(jsonObject.toString(), SwitchForSwingChecker.TIMER_CHECK_FLAG);
EventDispatchThreadHangMonitor.checkForDeadlock(); EventDispatchThreadHangMonitor.checkForDeadlock();
@ -128,7 +128,7 @@ public class CartonThreadExecutorPool extends ThreadPoolExecutor {
jsonObject.put(Toolkit.i18nText("Fine-Design_Basic_Carton_Output_Time"), simpleDateFormatThreadSafe.format(System.currentTimeMillis())); jsonObject.put(Toolkit.i18nText("Fine-Design_Basic_Carton_Output_Time"), simpleDateFormatThreadSafe.format(System.currentTimeMillis()));
jsonObject.put(Toolkit.i18nText("Fine-Design_Basic_Carton_Event_Number"), "swingWorker_" + concurrentHashMap.get(currentThreadId).hangNumber); jsonObject.put(Toolkit.i18nText("Fine-Design_Basic_Carton_Event_Number"), "swingWorker_" + concurrentHashMap.get(currentThreadId).hangNumber);
jsonObject.put(Toolkit.i18nText("Fine-Design_Basic_Carton_Task_Start_Time"), simpleDateFormatThreadSafe.format(concurrentHashMap.get(currentThreadId).startTime)); jsonObject.put(Toolkit.i18nText("Fine-Design_Basic_Carton_Task_Start_Time"), simpleDateFormatThreadSafe.format(concurrentHashMap.get(currentThreadId).startTime));
jsonObject.put(Toolkit.i18nText("Fine-Design_Basic_Carton_Task_Total_Time"), runTime); jsonObject.put(Toolkit.i18nText("Fine-Design_Basic_Carton_Task_Total_Time"), runTime + "ms");
EventDispatchThreadHangMonitor.outPutJournalLog(jsonObject.toString(), SwitchForSwingChecker.EASY_CHECK_FLAG); EventDispatchThreadHangMonitor.outPutJournalLog(jsonObject.toString(), SwitchForSwingChecker.EASY_CHECK_FLAG);
} }

26
designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java

@ -179,7 +179,7 @@ public final class EventDispatchThreadHangMonitor extends EventQueue {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Carton_Output_Time"), simpleDateFormat.format(System.currentTimeMillis())); jsonObject.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Carton_Output_Time"), simpleDateFormat.format(System.currentTimeMillis()));
jsonObject.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Carton_Event_Number"), "eventQueue_" + hangNumber); jsonObject.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Carton_Event_Number"), "eventQueue_" + hangNumber);
jsonObject.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Carton_Duration_Task_Execute"), timeSoFar()); jsonObject.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Carton_Duration_Task_Execute"), timeSoFar() + "ms");
jsonObject.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Carton_Stack_Info"), stackTrace); jsonObject.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Carton_Stack_Info"), stackTrace);
outPutJournalLog(jsonObject.toString(), SwitchForSwingChecker.TIMER_CHECK_FLAG); outPutJournalLog(jsonObject.toString(), SwitchForSwingChecker.TIMER_CHECK_FLAG);
checkForDeadlock(); checkForDeadlock();
@ -195,13 +195,27 @@ public final class EventDispatchThreadHangMonitor extends EventQueue {
//事件处理完后的时间判断 //事件处理完后的时间判断
public void dispose() { public void dispose() {
if (timeSoFar() > UNREASONABLE_DISPATCH_DURATION_MS) { if (timeSoFar() > UNREASONABLE_DISPATCH_DURATION_MS) {
JSONObject jsonObject = new JSONObject(); exportCartonLog(true);
jsonObject.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Carton_Output_Time"), simpleDateFormat.format(System.currentTimeMillis())); } else if (lastReportedStack != null){
jsonObject.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Carton_Event_Number"), "eventQueue_" + hangNumber); exportCartonLog(false);
jsonObject.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Carton_Task_Start_Time"), simpleDateFormat.format(startDispatchTimeMillis)); }
}
/**
*
* @param flag 判断一下输出日志时要输出哪个时间
*/
private void exportCartonLog(boolean flag) {
JSONObject jsonObject = new JSONObject();
jsonObject.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Carton_Output_Time"), simpleDateFormat.format(System.currentTimeMillis()));
jsonObject.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Carton_Event_Number"), "eventQueue_" + hangNumber);
jsonObject.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Carton_Task_Start_Time"), simpleDateFormat.format(startDispatchTimeMillis));
if (flag) {
jsonObject.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Carton_Task_Total_Time"), timeSoFar() + "ms"); jsonObject.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Carton_Task_Total_Time"), timeSoFar() + "ms");
outPutJournalLog(jsonObject.toString(), SwitchForSwingChecker.EASY_CHECK_FLAG); } else {
jsonObject.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Carton_Task_Total_Time"), totalTime() + "ms");
} }
outPutJournalLog(jsonObject.toString(), SwitchForSwingChecker.EASY_CHECK_FLAG);
} }
} }

3
designer-base/src/main/java/com/fr/design/carton/SwitchForSwingChecker.java

@ -180,7 +180,7 @@ public class SwitchForSwingChecker implements XMLReadable, XMLWriter {
CartonUploadMessage cartonUploadMessage = new CartonUploadMessage(); CartonUploadMessage cartonUploadMessage = new CartonUploadMessage();
JSONObject x = (JSONObject) jsonObject; JSONObject x = (JSONObject) jsonObject;
cartonUploadMessage.setHangCount(x.getString(Toolkit.i18nText("Fine-Design_Basic_Carton_Event_Number"))); cartonUploadMessage.setHangCount(x.getString(Toolkit.i18nText("Fine-Design_Basic_Carton_Event_Number")));
cartonUploadMessage.setSlowTime(x.getString(Toolkit.i18nText("Fine-Design_Basic_Carton_Output_Time")) + "ms"); cartonUploadMessage.setSlowTime(x.getString(Toolkit.i18nText("Fine-Design_Basic_Carton_Output_Time")));
cartonUploadMessage.setThreadTime("undefined"); cartonUploadMessage.setThreadTime("undefined");
//这个跟输出到文件中的格式匹配,参考EventDis里的stackTraceToString方法 //这个跟输出到文件中的格式匹配,参考EventDis里的stackTraceToString方法
String indentation = " "; String indentation = " ";
@ -308,4 +308,5 @@ public class SwitchForSwingChecker implements XMLReadable, XMLWriter {
writer.attr("easyChecker", easyChecker); writer.attr("easyChecker", easyChecker);
writer.end(); writer.end();
} }
} }

42
designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java

@ -207,7 +207,7 @@ public class DefaultTemplateTreeDefineProcessor extends AbstractTemplateTreeDefi
for (ExpandMutableTreeNode treeNode : treeNodeList) { for (ExpandMutableTreeNode treeNode : treeNodeList) {
FileOperationHelper.getInstance().checkFreeOrLock(treeNode, pasteNodes, lockedNodes); FileOperationHelper.getInstance().checkFreeOrLock(treeNode, pasteNodes, lockedNodes);
} }
if (pasteNodes.isEmpty()) { if (pasteNodes.isEmpty() || !lockedNodes.isEmpty()) {
//提示:复制的文件都不能黏贴 //提示:复制的文件都不能黏贴
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Basic_Confirm_Paste_Unlock_File"), Toolkit.i18nText("Fine-Design_Basic_Confirm_Paste_Unlock_File"),
@ -215,18 +215,7 @@ public class DefaultTemplateTreeDefineProcessor extends AbstractTemplateTreeDefi
WARNING_MESSAGE); WARNING_MESSAGE);
return; return;
} }
if (lockedNodes.isEmpty()) { doPaste(targetDir, pasteNodes);
doPaste(targetDir, pasteNodes);
} else {
if (FineJOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Basic_Confirm_Paste_Other_File"),
Toolkit.i18nText("Fine-Design_Basic_Confirm"),
YES_NO_OPTION)
== JOptionPane.YES_OPTION) {
// 黏贴其他可黏贴的文件
doPaste(targetDir, pasteNodes);
}
}
} }
/** /**
@ -329,21 +318,20 @@ public class DefaultTemplateTreeDefineProcessor extends AbstractTemplateTreeDefi
WARNING_MESSAGE); WARNING_MESSAGE);
return; return;
} }
// 筛选可以移动的文件
ArrayList<ExpandMutableTreeNode> moveNodes = new ArrayList<>();
ArrayList<ExpandMutableTreeNode> lockedNodes = new ArrayList<>();
for (ExpandMutableTreeNode treeNode : getFileTree().getSelectedTreeNodes()) {
FileOperationHelper.getInstance().checkFreeOrLock(treeNode, moveNodes, lockedNodes);
}
ExpandMutableTreeNode[] selectedTreeNodes = getFileTree().getSelectedTreeNodes(); if (!lockedNodes.isEmpty()) {
for (ExpandMutableTreeNode treeNode : selectedTreeNodes) { // 提醒被锁定模板无法移动
if (treeNode.getUserObject() instanceof FileNode) { FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
FileNode node = (FileNode) treeNode.getUserObject(); Toolkit.i18nText("Fine-Design_Basic_Unable_Move_Locked_File"),
String lock = node.getLock(); Toolkit.i18nText("Fine-Design_Basic_Alert"),
if (lock != null && !lock.equals(node.getUserID())) { WARNING_MESSAGE);
// 提醒被锁定模板无法移动 return;
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Basic_Unable_Move_Locked_File"),
Toolkit.i18nText("Fine-Design_Basic_Alert"),
WARNING_MESSAGE);
return;
}
}
} }
new TemplateMoveDialog(); new TemplateMoveDialog();

19
designer-base/src/main/java/com/fr/design/file/FileOperationHelper.java

@ -40,10 +40,10 @@ public class FileOperationHelper {
HistoryTemplateListCache.getInstance().deleteFile(nodeFILE); HistoryTemplateListCache.getInstance().deleteFile(nodeFILE);
FineLoggerFactory.getLogger().info("template {} move to {} success.", sourceFileNode.getEnvPath(), targetDir); FineLoggerFactory.getLogger().info("template {} move to {} success.", sourceFileNode.getEnvPath(), targetDir);
} else { } else {
//删除失败,将复制过去的文件删掉 //删除源文件失败,将复制过去的文件删掉
TemplateResourceManager.getResource().delete(new FileNodeFILE(targetPath)); TemplateResourceManager.getResource().delete(new FileNodeFILE(new FileNode(targetPath, sourceFileNode.isDirectory())));
FineLoggerFactory.getLogger().error("template {} move to {} failed.", sourceFileNode.getEnvPath(), targetDir); FineLoggerFactory.getLogger().error("template {} move to {} failed.", sourceFileNode.getEnvPath(), targetDir);
targetPath = StringUtils.EMPTY; throw new ResourceIOException(String.format("template %s move to %s failed", sourceFileNode.getEnvPath(), targetDir));
} }
} }
return targetPath; return targetPath;
@ -79,13 +79,16 @@ public class FileOperationHelper {
public boolean checkFreeOrLock(ExpandMutableTreeNode node, ArrayList<ExpandMutableTreeNode> dNodes, ArrayList<ExpandMutableTreeNode> lNodes) { public boolean checkFreeOrLock(ExpandMutableTreeNode node, ArrayList<ExpandMutableTreeNode> dNodes, ArrayList<ExpandMutableTreeNode> lNodes) {
// 自己没锁 // 自己没锁
boolean selfEmptyLock = false; boolean selfEmptyLock = false;
boolean dir = false;
Object userObj = node.getUserObject(); Object userObj = node.getUserObject();
if (userObj instanceof FileNode) { if (userObj instanceof FileNode) {
String lock = ((FileNode) userObj).getLock(); FileNode fileNode = (FileNode) userObj;
selfEmptyLock = lock == null || ((FileNode) userObj).getUserID().equals(lock); String lock = fileNode.getLock();
selfEmptyLock = lock == null || fileNode.getUserID().equals(lock);
dir = fileNode.isDirectory();
} }
if (node.isLeaf()) { if (!dir) {
if (selfEmptyLock) { if (selfEmptyLock) {
dNodes.add(node); dNodes.add(node);
} else { } else {
@ -130,7 +133,9 @@ public class FileOperationHelper {
FileNode[] fileNodes = TemplateTreePane.getInstance().getTemplateFileTree().listFile(sourceDir); FileNode[] fileNodes = TemplateTreePane.getInstance().getTemplateFileTree().listFile(sourceDir);
if (ArrayUtils.isEmpty(fileNodes)) { if (ArrayUtils.isEmpty(fileNodes)) {
//空目录:相当于新建一个目录 //空目录:相当于新建一个目录
DesignerFrameFileDealerPane.getInstance().getSelectedOperation().mkdir(targetDir); if (!DesignerFrameFileDealerPane.getInstance().getSelectedOperation().mkdir(targetDir)) {
throw new ResourceIOException(String.format("copy dir failed: from %s to %s.", sourceDir, targetDir));
}
return; return;
} }
for (FileNode fileNode : fileNodes) { for (FileNode fileNode : fileNodes) {

1
designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java

@ -393,6 +393,7 @@ public class TemplateTreePane extends JPanel implements FileOperations {
if (TemplateTreeSearchManager.getInstance().isInSearchMode()) { if (TemplateTreeSearchManager.getInstance().isInSearchMode()) {
TemplateTreeSearchManager.getInstance().deleteMatchedNode(deletedPaths); TemplateTreeSearchManager.getInstance().deleteMatchedNode(deletedPaths);
TemplateTreeSearchManager.getInstance().updateTemplateTree(); TemplateTreeSearchManager.getInstance().updateTemplateTree();
TemplateTreeSearchManager.getInstance().setRefreshing(false);
} else { } else {
TreePath[] paths = reportletsTree.getSelectionPaths(); TreePath[] paths = reportletsTree.getSelectionPaths();
if (paths == null) { if (paths == null) {

7
designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java

@ -35,6 +35,8 @@ public class TemplateFileTree extends EnvFileTree {
protected Map<String, ExpandMutableTreeNode> allTreeNode = new ConcurrentHashMap<>(); protected Map<String, ExpandMutableTreeNode> allTreeNode = new ConcurrentHashMap<>();
protected Map<String, ExpandMutableTreeNode> calculateNode = new ConcurrentHashMap<>(); protected Map<String, ExpandMutableTreeNode> calculateNode = new ConcurrentHashMap<>();
protected Map<String, List<String>> currentTreeMode = new ConcurrentHashMap<>(); protected Map<String, List<String>> currentTreeMode = new ConcurrentHashMap<>();
private static final int MAX_NODE_EXPAND_NUM = 50;
private static final int MAX_MATCHED_NODE_NUM = 500;
public TemplateFileTree() { public TemplateFileTree() {
super(ProjectConstants.REPORTLETS_NAME, null, null); super(ProjectConstants.REPORTLETS_NAME, null, null);
@ -272,7 +274,10 @@ public class TemplateFileTree extends EnvFileTree {
refreshTreeNode4TreeSearch(root); refreshTreeNode4TreeSearch(root);
sortTreeNode(root); sortTreeNode(root);
((DefaultTreeModel) this.getModel()).reload(root); ((DefaultTreeModel) this.getModel()).reload(root);
root.expandCurrentTreeNode(this); if (currentTreeMode.keySet().size() < MAX_NODE_EXPAND_NUM || TemplateTreeSearchManager.getInstance().matchesNode().length < MAX_MATCHED_NODE_NUM) {
//要展开的节点比较多的话,全部展开会有性能问题
root.expandCurrentTreeNode(this);
}
} }
/** /**

19
designer-base/src/main/java/com/fr/design/mainframe/manager/search/TemplateTreeSearchManager.java

@ -12,7 +12,9 @@ import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@ -129,7 +131,14 @@ public class TemplateTreeSearchManager {
setTreeSearchStatus(TreeSearchStatus.SEARCHING); setTreeSearchStatus(TreeSearchStatus.SEARCHING);
rendererHelper.replaceTreeRenderer(getCurrentTemplateTree(), searchText); rendererHelper.replaceTreeRenderer(getCurrentTemplateTree(), searchText);
FineLoggerFactory.getLogger().debug("start template search for search text: {}", searchText); FineLoggerFactory.getLogger().debug("start template search for search text: {}", searchText);
treeSearcher.startSearch(searchText); new SwingWorker<Void, Void>() {
@Override
protected Void doInBackground() throws Exception {
treeSearcher.startSearch(searchText);
return null;
}
}.execute();
} }
/** /**
@ -203,7 +212,13 @@ public class TemplateTreeSearchManager {
} }
public void deleteMatchedNode(Set<FileNode> fileNodes) { public void deleteMatchedNode(Set<FileNode> fileNodes) {
treeSearcher.getMatchSets().removeAll(fileNodes); Set<FileNode> deleteNode = new HashSet<>();
for (FileNode matchedNode : treeSearcher.getMatchSets()) {
if (fileNodes.stream().anyMatch(fileNode -> fileNode.getEnvPath().equals(matchedNode.getEnvPath()))) {
deleteNode.add(matchedNode);
}
}
treeSearcher.getMatchSets().removeAll(deleteNode);
} }
/** /**

6
designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/common/TemplateDirSearchCallBack.java

@ -24,10 +24,8 @@ public class TemplateDirSearchCallBack implements TreeSearchCallback {
if (TemplateDirTreeSearchManager.getInstance().getTreeSearchStatus() != TreeSearchStatus.SEARCHING) { if (TemplateDirTreeSearchManager.getInstance().getTreeSearchStatus() != TreeSearchStatus.SEARCHING) {
return; return;
} }
if (treeSearchResult.isSuccess()) { // 添加结果
// 添加结果 addToTreeSearcher(treeSearchResult);
addToTreeSearcher(treeSearchResult);
}
if (treeSearcher.getCalculatedCount() == treeSearcher.getAllDirSize()) { if (treeSearcher.getCalculatedCount() == treeSearcher.getAllDirSize()) {
updateTemplateTree(); updateTemplateTree();
} }

6
designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/common/TemplateSearchCallBack.java

@ -24,10 +24,8 @@ public class TemplateSearchCallBack implements TreeSearchCallback {
if (TemplateTreeSearchManager.getInstance().getTreeSearchStatus() != TreeSearchStatus.SEARCHING) { if (TemplateTreeSearchManager.getInstance().getTreeSearchStatus() != TreeSearchStatus.SEARCHING) {
return; return;
} }
if (treeSearchResult.isSuccess()) { // 添加结果
// 添加结果 addToTreeSearcher(treeSearchResult);
addToTreeSearcher(treeSearchResult);
}
updateTemplateTree(); updateTemplateTree();
} }

3
designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/common/TemplateSearchTask.java

@ -63,7 +63,8 @@ public class TemplateSearchTask implements TreeSearchTask {
* @param fileNode * @param fileNode
*/ */
private TreeSearchResult dealWithErrorTemplateWrapper(FileNode fileNode) { private TreeSearchResult dealWithErrorTemplateWrapper(FileNode fileNode) {
return new TemplateSearchResult.Builder().buildSuccess(false).build(); return new TemplateSearchResult.Builder().buildSuccess(false)
.buildAddToCalculated(Arrays.asList(fileNode.getEnvPath())).build();
} }
/** /**

4
designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pre/TemplatePreSearchCallBack.java

@ -17,9 +17,7 @@ public class TemplatePreSearchCallBack extends TemplateSearchCallBack {
@Override @Override
public void done(TreeSearchResult searchResult) { public void done(TreeSearchResult searchResult) {
if (searchResult.isSuccess()) { addToTreeSearcher(searchResult);
addToTreeSearcher(searchResult);
}
} }
/** /**

2
designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pre/TemplatePreSearchTask.java

@ -37,7 +37,7 @@ public class TemplatePreSearchTask implements TreeSearchTask {
FineLoggerFactory.getLogger().info("[Template Search] calculate {} child nodes success. total child node num is: {}", fileNode.getEnvPath(), allChildNode.size()); FineLoggerFactory.getLogger().info("[Template Search] calculate {} child nodes success. total child node num is: {}", fileNode.getEnvPath(), allChildNode.size());
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error("[Template Search] calculate {} child nodes failed", fileNode.getEnvPath()); FineLoggerFactory.getLogger().error("[Template Search] calculate {} child nodes failed", fileNode.getEnvPath());
result = new TemplateSearchResult.Builder().buildSuccess(false).build(); result = new TemplateSearchResult.Builder().buildAddToNotCalculated(new ArrayList<>()).buildSuccess(false).build();
} }
callback.done(result); callback.done(result);
} }

Loading…
Cancel
Save