| So, what bugged me with this one is that, in the case of the Keycloak report, the metadata were initialized even if there were no constraints at all. This, using 5.x so still with the UnconstrainedEntityMetaDataSingleton optimization. The reason for it is that when using CDI, we don't test with BeanMetaDataManager#isConstrained() before getting the metadata. Thus, it totally disables this optimization. Testing with BeanMetaDataManager#isConstrained() is not possible as it is not exposed in the Validator API. Gunnar Morling Maybe we should consider exposing an isConstrained() method in Validator in a future version of the spec? |