|
14 | 14 | package org.eclipse.core.internal.filesystem;
|
15 | 15 |
|
16 | 16 | import java.net.URI;
|
17 |
| -import java.util.HashMap; |
| 17 | +import java.util.Map; |
| 18 | +import java.util.concurrent.ConcurrentHashMap; |
| 19 | +import java.util.concurrent.ConcurrentMap; |
18 | 20 | import org.eclipse.core.filesystem.EFS;
|
19 | 21 | import org.eclipse.core.filesystem.IFileStore;
|
20 | 22 | import org.eclipse.core.filesystem.IFileSystem;
|
@@ -43,7 +45,7 @@ public class InternalFileSystemCore implements IRegistryChangeListener {
|
43 | 45 | * element for the extension. Once the file system has been created, the
|
44 | 46 | * map contains the IFileSystem instance for that scheme.
|
45 | 47 | */
|
46 |
| - private HashMap<String, Object> fileSystems; |
| 48 | + private ConcurrentMap<String, Object> fileSystems; |
47 | 49 |
|
48 | 50 | /**
|
49 | 51 | * Returns the singleton instance of this class.
|
@@ -71,7 +73,7 @@ private InternalFileSystemCore() {
|
71 | 73 | public IFileSystem getFileSystem(String scheme) throws CoreException {
|
72 | 74 | if (scheme == null)
|
73 | 75 | throw new NullPointerException();
|
74 |
| - final HashMap<String, Object> registry = getFileSystemRegistry(); |
| 76 | + final Map<String, Object> registry = getFileSystemRegistry(); |
75 | 77 | Object result = registry.get(scheme);
|
76 | 78 | if (result == null)
|
77 | 79 | Policy.error(EFS.ERROR_INTERNAL, NLS.bind(Messages.noFileSystem, scheme));
|
@@ -129,9 +131,9 @@ public IFileStore getStore(URI uri) throws CoreException {
|
129 | 131 | * Returns the fully initialized file system registry
|
130 | 132 | * @return The file system registry
|
131 | 133 | */
|
132 |
| - private synchronized HashMap<String, Object> getFileSystemRegistry() { |
| 134 | + private synchronized ConcurrentMap<String, Object> getFileSystemRegistry() { |
133 | 135 | if (fileSystems == null) {
|
134 |
| - fileSystems = new HashMap<>(); |
| 136 | + fileSystems = new ConcurrentHashMap<>(); |
135 | 137 | IExtensionPoint point = RegistryFactory.getRegistry().getExtensionPoint(EFS.PI_FILE_SYSTEM, EFS.PT_FILE_SYSTEMS);
|
136 | 138 | IExtension[] extensions = point.getExtensions();
|
137 | 139 | for (IExtension extension : extensions) {
|
|
0 commit comments