java-json-tools / json-schema-validator

A JSON Schema validation implementation in pure Java, which aims for correctness and performance, in that order
http://json-schema-validator.herokuapp.com/
Other
1.63k stars 399 forks source link

Unused default LoadingConfiguration in JsonSchemaFactoryBuilder. #290

Closed Capstan closed 5 years ago

Capstan commented 5 years ago

In our test infrastructure, we restrict thread creation for "small" tests. In upgrading from v1.6.2 to v2.2.10, we found the new JsonSchemaFactoryBuilder will uniformly create the default LoadingConfiguration, even if it gets replaced by a custom config, and that has a side-effect of loading some unused error messages in URIUtils.java, which spawns a thread.

Perhaps if the Builder's init left the reportProvider, loadingCfg, and validationCfg as null, and moved the application of defaults to remaining null values in freeze(), the unused defaults would never be created in the first place.