pholser/junit-quickcheck

Please refrain from using Math.abs(int) when "non-negative integer" is required

vlsi opened this issue · 3 comments

vlsi commented

Math.abs(Integer.MIN_VALUE) produces Integer.MIN_VALUE, so Math.abs does not produce "non-negative integers".

Sample pages with issues:
https://pholser.github.io/junit-quickcheck/site/0.9/usage/configuring.html
https://pholser.github.io/junit-quickcheck/site/0.9/usage/complex-types.html

@vlsi Thanks for this. Will adjust.

@vlsi Check out the PR above -- let me know whether or not this will suffice. Thanks!

vlsi commented

It looks ok, so people might even learn that the should not try Math.abs(MIN_VALUE) at home :)