Skip to content

Fix parameters of RandomData.setSeed()#14

Open
benbender wants to merge 1 commit intomartinpaljak:nextfrom
benbender:patch-1
Open

Fix parameters of RandomData.setSeed()#14
benbender wants to merge 1 commit intomartinpaljak:nextfrom
benbender:patch-1

Conversation

@benbender
Copy link

@benbender benbender commented Jan 17, 2026

Random.Data.setSeed() uses offset/length-parameters:
setSeed(byte[] buffer, short offset, short length)

Where java.util.Arrays.copyOfRange() uses a from/to-notation:
copyOfRange(byte[] original, int from, int to)

Besides the different semantics, this difference can lead to an IllegalArgumentException if offset is larger than the length of the seed.

This small patch fixes the handling.

Random.Data.setSeed uses offset/length-parameters:
```setSeed(byte[] buffer, short offset, short length)```

Where java.util.Arrays.copyOfRange() uses a from/to-notation:
```copyOfRange(boolean[] original, int from, int to)````

This small patch fixes the handling.
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.

1 participant