Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LocalValidatorFactoryBean doesn't implement ValidatorFactory.getClockProvider() [SPR-17462] #21994

Closed
spring-issuemaster opened this issue Nov 2, 2018 · 2 comments
Assignees

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Nov 2, 2018

pjverity opened SPR-17462 and commented

Using spring-boot 2.1.0.RELEASE, I use the starter:

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-validation</artifactId>
</dependency>

This places javax.validation:validation-api:2.0.1.Final on the classpath. That version of the validation API has an interface method ValidatorFactory.``ClockProvider getClockProvider() which isn't implemented by LocalValidatorFactoryBean.

The code is here:

implements ValidatorFactory, ApplicationContextAware, InitializingBean, DisposableBean {


Affects: 5.1.2

Reference URL:

implements ValidatorFactory, ApplicationContextAware, InitializingBean, DisposableBean {

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Nov 2, 2018

pjverity commented

Ah. Just read the JavaDoc - perhaps this is intentional.

If you'd like to call BV 2.0's getClockProvider() method, obtain the native ValidatorFactory through unwrap(ValidatorFactory.class)

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Nov 4, 2018

Juergen Hoeller commented

Indeed, this is intentional since we need to retain Bean Validation 1.1 compatibility at runtime for the time being. LocalValidatorFactoryBean is only really a bootstrap delegate and not internally injected into constraint implementations (which is where getClockProvider() is meant to be used), so there shouldn't be any practical implications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.