Skip to content

Conversation

@sjoerdtalsma
Copy link
Contributor

No description provided.

Signed-off-by: Sjoerd Talsma <sjoerdtalsma@users.noreply.github.com>
@sjoerdtalsma sjoerdtalsma requested a review from Copilot May 7, 2025 13:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR extends java.util.Random by adding richer generator methods to support random selection from arrays, collections, enums, and generating random strings, along with the corresponding tests.

  • Introduces new methods in RandomGenerator.java such as nextValueFrom, nextValueExcept, nextString, and shuffleCharacters.
  • Adds comprehensive tests in RandomGeneratorTest.java to validate behavior across different data types.
  • Introduces ExampleEnum.java for testing enum generation.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/main/java/nl/talsmasoftware/misc/utils/RandomGenerator.java Implements richer random generator methods and updates Javadoc comments.
src/test/java/nl/talsmasoftware/misc/utils/RandomGeneratorTest.java Adds tests covering the new random generation functionalities.
src/test/java/nl/talsmasoftware/misc/utils/ExampleEnum.java Provides a sample enum for testing nextEnum method.
Comments suppressed due to low confidence (1)

src/test/java/nl/talsmasoftware/misc/utils/RandomGeneratorTest.java:111

  • [nitpick] The variable name 'lengte' is in a different language than the rest of the code; consider renaming it to 'length' for consistency.
final int lengte = 5 + RND.nextInt(10);

sjoerdtalsma and others added 5 commits May 7, 2025 15:35
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sjoerd Talsma <sjoerdtalsma@users.noreply.github.com>
Signed-off-by: Sjoerd Talsma <sjoerdtalsma@users.noreply.github.com>
Signed-off-by: Sjoerd Talsma <sjoerdtalsma@users.noreply.github.com>
Signed-off-by: Sjoerd Talsma <sjoerdtalsma@users.noreply.github.com>
Signed-off-by: Sjoerd Talsma <sjoerdtalsma@users.noreply.github.com>
@sjoerdtalsma sjoerdtalsma requested a review from Copilot May 8, 2025 12:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces a new RandomGenerator class that extends java.util.Random with richer generators and convenience methods such as nextEnum, nextString, and nextValueExcept. It also adds comprehensive tests for these new methods as well as an example enum for verifying enum-based random generation.

  • Added RandomGenerator.java with additional random generator methods.
  • Added RandomGeneratorTest.java to validate the new functionality.
  • Introduced ExampleEnum.java for testing nextEnum.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/main/java/nl/talsmasoftware/misc/utils/RandomGenerator.java Implements additional generator methods, including methods to generate enums, strings, and values excluding specified entries.
src/test/java/nl/talsmasoftware/misc/utils/RandomGeneratorTest.java Provides extensive tests for the new methods.
src/test/java/nl/talsmasoftware/misc/utils/ExampleEnum.java Supplies an enum needed to test the nextEnum method.
Comments suppressed due to low confidence (1)

src/test/java/nl/talsmasoftware/misc/utils/RandomGeneratorTest.java:79

  • [nitpick] The variable name 'alleWaarden' is in Dutch while other variables are in English. Consider renaming it to 'allValues' for consistency.
Iterable<String> alleWaarden = list::iterator;

sjoerdtalsma and others added 2 commits May 8, 2025 14:47
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sjoerd Talsma <sjoerdtalsma@users.noreply.github.com>
Signed-off-by: Sjoerd Talsma <sjoerdtalsma@users.noreply.github.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented May 8, 2025

@sjoerdtalsma sjoerdtalsma merged commit e72044e into main May 8, 2025
5 checks passed
@sjoerdtalsma sjoerdtalsma deleted the feature/random-generator branch May 8, 2025 13:03
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