Browse Source

改掉import *

feature/x
roger 2 years ago
parent
commit
671a89c9e6
  1. 2
      designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/TemplateDirTreeSearcher.java
  2. 12
      designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/TemplateTreeSearcher.java

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

@ -91,7 +91,7 @@ public class TemplateDirTreeSearcher extends TemplateTreeSearcher {
* *
* @param fileNodes * @param fileNodes
*/ */
public void addToNotCalculatedSets(List<FileNode> fileNodes) { public synchronized void addToNotCalculatedSets(List<FileNode> fileNodes) {
synchronized (lock) { synchronized (lock) {
Map<String, FileNode> chileMap = fileNodes.stream().collect(Collectors.toMap(FileNode::getEnvPath, treeNode -> treeNode)); Map<String, FileNode> chileMap = fileNodes.stream().collect(Collectors.toMap(FileNode::getEnvPath, treeNode -> treeNode));
notCalculatedSets.addAll(chileMap.keySet()); notCalculatedSets.addAll(chileMap.keySet());

12
designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/TemplateTreeSearcher.java

@ -13,8 +13,14 @@ import com.fr.file.filetree.FileNode;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import java.util.*; import java.util.Arrays;
import java.util.concurrent.*; import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executors;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -82,7 +88,7 @@ public class TemplateTreeSearcher implements TreeSearcher {
* *
* @param fileNodes * @param fileNodes
*/ */
public void addToNotCalculatedSets(List<FileNode> fileNodes) { public synchronized void addToNotCalculatedSets(List<FileNode> fileNodes) {
synchronized (lock) { synchronized (lock) {
Map<String, FileNode> chileMap = fileNodes.stream().collect(Collectors.toMap(FileNode::getEnvPath, treeNode -> treeNode)); Map<String, FileNode> chileMap = fileNodes.stream().collect(Collectors.toMap(FileNode::getEnvPath, treeNode -> treeNode));
notCalculatedSets.addAll(chileMap.keySet()); notCalculatedSets.addAll(chileMap.keySet());

Loading…
Cancel
Save