@@ -57,6 +57,8 @@ public final class LoadingConfigurationBuilder
57
57
* EnumSets to collect them, so we have to do that...
58
58
*/
59
59
private static final EnumSet <JsonParser .Feature > DEFAULT_PARSER_FEATURES ;
60
+
61
+ private static final int DEFAULT_CACHE_SIZE = 512 ;
60
62
61
63
static {
62
64
DEFAULT_PARSER_FEATURES = EnumSet .noneOf (JsonParser .Feature .class );
@@ -78,9 +80,9 @@ public final class LoadingConfigurationBuilder
78
80
URITranslatorConfiguration translatorCfg ;
79
81
80
82
/**
81
- * Cache size is 4096 by default
83
+ * Cache size is 512 by default
82
84
*/
83
- int cacheSize = 4096 ;
85
+ int cacheSize = DEFAULT_CACHE_SIZE ;
84
86
85
87
/**
86
88
* Dereferencing mode
@@ -134,11 +136,29 @@ public final class LoadingConfigurationBuilder
134
136
parserFeatures = EnumSet .copyOf (cfg .parserFeatures );
135
137
cacheSize = cfg .cacheSize ;
136
138
}
139
+
140
+ /**
141
+ * Should we enable caching of downloaded schemas
142
+ *
143
+ * @deprecated Just for backward compatibility
144
+ * Use cacheSize setter instead to set the maximum size of the cache
145
+ *
146
+ * <p>Note that this does <b>not</b> affect preloaded schemas</p>
147
+ *
148
+ * @param enableCache if loaded schemas have to be cached
149
+ * @return this
150
+ */
151
+ @ Deprecated
152
+ public LoadingConfigurationBuilder setEnableCache (final boolean enableCache )
153
+ {
154
+ this .cacheSize = enableCache ? DEFAULT_CACHE_SIZE : 0 ;
155
+ return this ;
156
+ }
137
157
138
158
/**
139
159
* How many schemas should be cached
140
- * <p>Note setting to zero effectively disable the cache</p>
141
- * <p>Note not settting the chache size or setting to -1, creates an unlimited cache</p>
160
+ * <p>Note setting to zero effectively disables the cache</p>
161
+ * <p>Note settting to -1 creates an unlimited cache</p>
142
162
* <p>Note that this does <b>not</b> affect preloaded schemas</p>
143
163
*
144
164
* @param cacheSize if loaded schemas have to be cached
0 commit comments