Skip to content

Issue #1487: use ThreadLocalRandom to generate random number in Route…#1494

Merged
thboileau merged 1 commit into2.6from
tboileau/2.6_Issue-1487_Random_instance
Mar 8, 2026
Merged

Issue #1487: use ThreadLocalRandom to generate random number in Route…#1494
thboileau merged 1 commit into2.6from
tboileau/2.6_Issue-1487_Random_instance

Conversation

@thboileau
Copy link
Contributor

…List

The aim

As reported By Tim, let's use ThreadLocalRandom.current()to generate random numbers in RouteList class

Check-list

  • PR size
    • Under 300 lines ✅
    • Can't be split without complicating the process even more
  • Tests
    • Added
    • Not applicable (already tests)
  • Doc
    • Added
    • Not applicable
  • Reviewer
    • Asked for a review
    • Added label DO NOT REVIEW

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 8, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

@thboileau thboileau merged commit 17e1524 into 2.6 Mar 8, 2026
5 of 6 checks passed
@thboileau thboileau deleted the tboileau/2.6_Issue-1487_Random_instance branch March 8, 2026 18:02
@Tembrel
Copy link
Collaborator

Tembrel commented Mar 8, 2026

The only downsides of ThreadLocalRandom are that

  • it isn't cryptographically secure, and
  • its behavior is not reproducible, e.g., for testing.

But the former is clearly not a concern here, and if the latter is a concern, then presumably the unit test machinery can be tweaked to produce predictable values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants