2
0
Fork 0
mirror of https://github.com/ethauvin/rife2.git synced 2025-05-01 11:08:11 -07:00

Switch memoryusers to use concurrent hashmap

This commit is contained in:
Geert Bevin 2023-01-16 19:10:32 -05:00
parent 8d5b7e5314
commit f8e24042f1

View file

@ -8,12 +8,11 @@ import rife.resources.exceptions.ResourceFinderErrorException;
import rife.tools.*; import rife.tools.*;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.StringBufferInputStream;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/** /**
* This class offers {@code ResourceFinder} and {@code ResourceWriter} * This class offers {@code ResourceFinder} and {@code ResourceWriter}
@ -28,7 +27,7 @@ public class MemoryResources extends AbstractResourceFinder implements ResourceW
} }
private static final String PROTOCOL = "file"; private static final String PROTOCOL = "file";
private final Map<String, MemoryResource> resources_ = new HashMap<>(); private final Map<String, MemoryResource> resources_ = new ConcurrentHashMap<>();
/** /**
* Creates a new instance. * Creates a new instance.