-
Notifications
You must be signed in to change notification settings - Fork 205
Support custom Random Generators #1562
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
Conversation
PR Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you revert the formatting changes?
Not that any of them are wrong but just to keep this focused on the relevant changes.
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #1562 +/- ##
============================================
+ Coverage 92.45% 92.50% +0.04%
- Complexity 3308 3312 +4
============================================
Files 329 329
Lines 6507 6510 +3
Branches 632 632
============================================
+ Hits 6016 6022 +6
+ Misses 338 337 -1
+ Partials 153 151 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8a08712
to
512838b
Compare
this was by mistake, removed it now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
if (shuffledLocales.isEmpty() || shuffledLocaleIndex >= shuffledLocales.size() - 1) { | ||
// copy list of locales supported into shuffledLocales | ||
shuffledLocales.clear(); | ||
shuffledLocales.addAll(LOCALES); | ||
shuffledLocaleIndex = 0; | ||
Collections.shuffle(shuffledLocales, random); | ||
Collections.shuffle(shuffledLocales, (Random) random); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I missed something, but what is the point of declaring parameter as RandomGenerator
if we anyway cast it to Random
? Then no any other types would work here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because this new method does start to exist in jdk21... this would break the compatibility for jdk17
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but good point - seems there is not test for that...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a way to fix it now... but the same is true for RgxGen, so this would need to be fixed first
depends on curious-odd-man/RgxGen#108 |
…m generator injection
the new version 3.0 of RgxGen supports RandomGenerator now |
Add support for using custom
RandomGenerators
likeSplittableRandom
for improved speed and less overhead