From 2bb94801374d9c63f4136be909e9d2456c687b35 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Sun, 27 Oct 2019 09:54:16 +0000 Subject: [PATCH] the filetree map gets accessed from the directory watcher thread --- core/src/main/groovy/com/muwire/core/files/FileTree.groovy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/groovy/com/muwire/core/files/FileTree.groovy b/core/src/main/groovy/com/muwire/core/files/FileTree.groovy index dd02389c..180d4088 100644 --- a/core/src/main/groovy/com/muwire/core/files/FileTree.groovy +++ b/core/src/main/groovy/com/muwire/core/files/FileTree.groovy @@ -1,9 +1,11 @@ package com.muwire.core.files +import java.util.concurrent.ConcurrentHashMap + class FileTree { private final TreeNode root = new TreeNode() - private final Map fileToNode = new HashMap<>() + private final Map fileToNode = new ConcurrentHashMap<>() void add(File file) { List path = new ArrayList<>()