Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upRRset.cycle() short overflows #102
Comments
|
|
|
Sure! I need to get some confirmations first though |
|
Sorry, was still stuck in bureaucracy hell |
Hey there!
We recently run into the following issue, after upgrading to 3.0.2:
Stacktrace
Cause:
This happens because of:
Eventually (when position > 32.767) it overflows and goes negative. This leads to a negative modulo because... that's how Java wills it. Sublist then blows up because it always expects positive
Reproducing:
rrs()orrrs(true)more than 32.767 timesTest (uses Junit 5 but feel free to switch it to 4):
The
cycleAboveShort()method eventually throws.Suggested solution:
You can either use one of the suggestions in the link for always positive modulo, or an iterator that resets. I like the latter solution much more
Other notices:
Have a great day!