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

fix: [RTD-955] random generator gives negative numbers #300

Merged
merged 3 commits into from Nov 28, 2022

Conversation

and-mora
Copy link
Contributor

@and-mora and-mora commented Nov 28, 2022

Description

This PR proposes to fix the number generation of negative values replacing the long with a UUID truncated to 20 chars.

List of Changes

  • changed secure random method with a random UUID

Motivation and Context

The random number generated is also negative and it creates troubles to senders. The nextLong() method in java 8 does not support the upperbound feature, therefore the SecureRandom has been replaced with a random UUID without dash and truncated at 20 chars.

How Has This Been Tested?

  • Unit Test Suite
  • Integration Test Suite
  • Load Tests

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Chore change (non-breaking change which doesn't provide a direct value to users)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@and-mora and-mora marked this pull request as ready for review November 28, 2022 09:51
@sonarcloud
Copy link

sonarcloud bot commented Nov 28, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@TommasoLencioni TommasoLencioni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 😍

@and-mora and-mora merged commit 7c6efe9 into develop Nov 28, 2022
@and-mora and-mora deleted the RTD-955-random-generates-negative-number branch November 28, 2022 13:45
@github-actions
Copy link

🎉 This PR is included in version 1.4.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

2 participants