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

Fundamental issue in random-beans-validation #237

Closed
devoto13 opened this issue Feb 15, 2017 · 3 comments
Closed

Fundamental issue in random-beans-validation #237

devoto13 opened this issue Feb 15, 2017 · 3 comments
Labels
Milestone

Comments

@devoto13
Copy link

I found fundamental problem in random-beans-validation implementation. Currently every randomizer created by the package will generate same value every time (or almost every time, see below).

Let's for example look into SizeAnnotationHandler.

Every time randomizer is looked up for field annotated with @Size it will create new instance of CharacterRandomizer providing it with same seed and therefore randomizer will generate same value every time. Or almost every time, because randomizer for string length is not using seed (but it should). Other annotation handlers have same issue, except those generating constant values (for obvious reasons).

Ideal solution would be to somehow cache randomizers created for the field from annotation. But I'm not good with Java, so not sure how feasible/doable it is.

PascalSchumacher added a commit to PascalSchumacher/easy-random that referenced this issue Feb 15, 2017
PascalSchumacher added a commit to PascalSchumacher/easy-random that referenced this issue Feb 16, 2017
fmbenhassine added a commit that referenced this issue Feb 16, 2017
make random-beans-validation more random (fixes #237)
@fmbenhassine fmbenhassine reopened this Feb 16, 2017
@fmbenhassine
Copy link
Member

Hi @devoto13

Thank you for reporting this. We have deployed a fix in 3.6.0-SNAPSHOT.

Could you please give it a try and tell us if this is ok for you?

Kind regards
Mahmoud

@fmbenhassine fmbenhassine modified the milestones: 3.5.1, 3.6.0 Feb 16, 2017
@devoto13
Copy link
Author

@benas @PascalSchumacher Thank you, guys, for a quick fix!

I tried it and it works very well. Closing the issue.

@PascalSchumacher
Copy link
Collaborator

Thanks reporting the issue and for the feedback on the fix. 👍 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants