| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,9 +34,9 @@ | |||
| 34 | 34 | import java.util.ArrayList; | |
| 35 | 35 | import java.util.Arrays; | |
| 36 | 36 | import java.util.Date; | |
| 37 | - import java.util.HashMap; | ||
| 38 | 37 | import java.util.List; | |
| 39 | 38 | import java.util.Map; | |
| 39 | + import java.util.concurrent.ConcurrentHashMap; | ||
| 40 | 40 | import javax.annotation.concurrent.NotThreadSafe; | |
| 41 | 41 | ||
| 42 | 42 | /** | |
@@ -77,11 +77,11 @@ class FakeStorageRpc extends StorageRpcTestBase { | |||
| 77 | 77 | new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); | |
| 78 | 78 | ||
| 79 | 79 | // fullname -> metadata | |
| 80 | - Map<String, StorageObject> metadata = new HashMap<>(); | ||
| 80 | + Map<String, StorageObject> metadata = new ConcurrentHashMap<>(); | ||
| 81 | 81 | // fullname -> contents | |
| 82 | - Map<String, byte[]> contents = new HashMap<>(); | ||
| 82 | + Map<String, byte[]> contents = new ConcurrentHashMap<>(); | ||
| 83 | 83 | // fullname -> future contents that will be visible on close. | |
| 84 | - Map<String, byte[]> futureContents = new HashMap<>(); | ||
| 84 | + Map<String, byte[]> futureContents = new ConcurrentHashMap<>(); | ||
| 85 | 85 | ||
| 86 | 86 | private final boolean throwIfOption; | |
| 87 | 87 | ||
@@ -92,8 +92,8 @@ public FakeStorageRpc(boolean throwIfOption) { | |||
| 92 | 92 | ||
| 93 | 93 | // remove all files | |
| 94 | 94 | void reset() { | |
| 95 | - metadata = new HashMap<>(); | ||
| 96 | - contents = new HashMap<>(); | ||
| 95 | + metadata = new ConcurrentHashMap<>(); | ||
| 96 | + contents = new ConcurrentHashMap<>(); | ||
| 97 | 97 | } | |
| 98 | 98 | ||
| 99 | 99 | @Override | |
@@ -149,7 +149,7 @@ public Tuple<String, Iterable<StorageObject>> list(String bucket, Map<Option, ?> | |||
| 149 | 149 | final String prefix = preprefix; | |
| 150 | 150 | ||
| 151 | 151 | List<StorageObject> values = new ArrayList<>(); | |
| 152 | - Map<String, StorageObject> folders = new HashMap<>(); | ||
| 152 | + Map<String, StorageObject> folders = new ConcurrentHashMap<>(); | ||
| 153 | 153 | for (StorageObject so : metadata.values()) { | |
| 154 | 154 | if (!so.getBucket().equals(bucket) || !so.getName().startsWith(prefix)) { | |
| 155 | 155 | continue; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments