diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractLanguageSettingsOutputScanner.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractLanguageSettingsOutputScanner.java index ac877d93ebb..9b78ffd563e 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractLanguageSettingsOutputScanner.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractLanguageSettingsOutputScanner.java @@ -19,6 +19,7 @@ import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashSet; @@ -94,11 +95,11 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett private static final int FIND_RESOURCES_CACHE_SIZE = 100; - private LRUCache workspaceRootFindContainersForLocationURICache = new LRUCache<>( - FIND_RESOURCES_CACHE_SIZE); - private LRUCache workspaceRootFindFilesForLocationURICache = new LRUCache<>( - FIND_RESOURCES_CACHE_SIZE); - private HashMap>> findPathInProjectCache = new HashMap<>(); + private Map workspaceRootFindContainersForLocationURICache = Collections.synchronizedMap(new LRUCache<>( + FIND_RESOURCES_CACHE_SIZE)); + private Map workspaceRootFindFilesForLocationURICache = Collections.synchronizedMap(new LRUCache<>( + FIND_RESOURCES_CACHE_SIZE)); + private Map>> Collections.synchronizedMap(findPathInProjectCache = new HashMap<>()); //String pathStr, URI baseURI -> URI private static class MappedURIKey { @@ -144,11 +145,11 @@ public boolean equals(Object obj) { } // Caches the result of determineMappedURI - private LRUCache mappedURICache = new LRUCache<>(FIND_RESOURCES_CACHE_SIZE); + private Map mappedURICache = Collections.synchronizedMap(new LRUCache<>(FIND_RESOURCES_CACHE_SIZE)); // Caches the result of getFilesystemLocation - private LRUCache fileSystemLocationCache = new LRUCache<>(FIND_RESOURCES_CACHE_SIZE); + private Map fileSystemLocationCache = Collections.synchronizedMap(new LRUCache<>(FIND_RESOURCES_CACHE_SIZE)); // Caches the result of new File(pathname).exists() - private LRUCache pathExistsCache = new LRUCache<>(FIND_RESOURCES_CACHE_SIZE); + private Map pathExistsCache = Collections.synchronizedMap(new LRUCache<>(FIND_RESOURCES_CACHE_SIZE)); /** @since 8.2 */ protected EFSExtensionProvider efsProvider = null;