| My issue with WildFly calling a private Validation.clearValidationProviderCache(), is that wouldn't age very well over time. Eventually, we have to worry about some future maintainer, doing the wrong thing with clearValidationProviderCache(), as in they might remove the call to clearValidationProviderCache() (causing memory use to increase) or they might remove the HV side implementation of clearValidationProviderCache(), causing confusion to the caller(s). We probably could introduce a Platform interface class, that could be implemented by javax.validation.Validation and then, WildFly (and others), could clear the provider validation provider cache at the best time(s).
public interface Platform {
clearValidationProviderCache();
}
I suppose that an alternative could be introducing a BV spec change, to account for caching + cache clearing. |