-
Notifications
You must be signed in to change notification settings - Fork 224
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
volidator不同的类不能复用吗 #22
Comments
是可以复用的,这里仅仅是为了做一个单例的Validator,保证全局有且仅有一个该类型的Validator。这需要开发人员保证Validator是thread-safe的。 |
CLASS_2_ANNOTATION_VALIDATOR_MAP是根据待验证类的class缓存的该类里的所有validator 因为上面那个问题导致 CLASS_2_ANNOTATION_VALIDATOR_MAP 最后存的validators是空的,然后在执行doValidate时 导致执行不到@FluentValidate指定的验证类 |
可以贴出来复现问题的代码吗? |
package com.baidu.unbiz.fluentvalidator; import org.junit.Test; import com.baidu.unbiz.fluentvalidator.annotation.FluentValidate; public class ValidatorTest {
} |
在验证bcar时 就不执行NameValidator了 |
I will look into the issue later. |
Great catch! I am enable to reproduce the problem, your solution works, would you mind to create a PR? Or I can update the issue by myself. Thanks for you finding! |
Fixed. So close the issue. |
The text was updated successfully, but these errors were encountered: