File tree 2 files changed +13
-1
lines changed
src/main/java/com/fasterxml/jackson/databind
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -2272,9 +2272,14 @@ public ObjectMapper setConstructorDetector(ConstructorDetector cd) {
2272
2272
/**
2273
2273
* Method for specifying {@link CacheProvider} instance, to provide Cache instances to be used in components downstream.
2274
2274
*
2275
+ * @cacheProvider Cache provider for this mapper to use
2276
+ *
2277
+ * @throws IllegalArgumentException if given provider is null
2278
+ *
2275
2279
* @since 2.16
2276
2280
*/
2277
2281
public ObjectMapper setCacheProvider (CacheProvider cacheProvider ) {
2282
+ _assertNotNull ("cacheProvider" , cacheProvider );
2278
2283
_deserializationConfig = _deserializationConfig .with (cacheProvider );
2279
2284
_serializationConfig = _serializationConfig .with (cacheProvider );
2280
2285
return this ;
Original file line number Diff line number Diff line change @@ -24,6 +24,13 @@ public final class DeserializerCache
24
24
{
25
25
private static final long serialVersionUID = 1L ;
26
26
27
+ /**
28
+ * Default size of the underlying cache to use.
29
+ *
30
+ * @since 2.16
31
+ */
32
+ public final static int DEFAULT_MAX_CACHE_SIZE = 2000 ;
33
+
27
34
/*
28
35
/**********************************************************
29
36
/* Caching
@@ -52,7 +59,7 @@ public final class DeserializerCache
52
59
*/
53
60
54
61
public DeserializerCache () {
55
- this (2000 ); // see [databind#1995]
62
+ this (DEFAULT_MAX_CACHE_SIZE ); // see [databind#1995]
56
63
}
57
64
58
65
public DeserializerCache (int maxSize ) {
You can’t perform that action at this time.
0 commit comments