Skip to content

Commit f8cd828

Browse files
committed
DefaultSchemaResolver use ConcurrentMap
1 parent 607cf71 commit f8cd828

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/dev/harrel/jsonschema/ValidatorFactory.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
import java.net.URI;
66
import java.util.*;
7+
import java.util.concurrent.ConcurrentHashMap;
8+
import java.util.concurrent.ConcurrentMap;
79
import java.util.function.Supplier;
810

911
/**
@@ -253,7 +255,7 @@ public Validator.Result validate(JsonNode schemaNode, JsonNode instanceNode) {
253255
}
254256

255257
static class DefaultSchemaResolver implements SchemaResolver {
256-
private final Map<String, String> schemaCache = new HashMap<>();
258+
private final ConcurrentMap<String, String> schemaCache = new ConcurrentHashMap<>();
257259

258260
@Override
259261
public Result resolve(String uri) {

0 commit comments

Comments
 (0)