mirror of https://github.com/apache/lucene.git
make sure we don't build circles with zero radius in ShapeTestUtil
This commit is contained in:
parent
1038fe8bee
commit
0864b39a11
|
@ -71,7 +71,11 @@ public class ShapeTestUtil {
|
|||
Random random = random();
|
||||
float x = nextFloat(random);
|
||||
float y = nextFloat(random);
|
||||
float radius = random().nextFloat() * Float.MAX_VALUE / 2;
|
||||
float radius = 0;
|
||||
while (radius == 0) {
|
||||
radius = random().nextFloat() * Float.MAX_VALUE / 2;
|
||||
}
|
||||
assert radius != 0;
|
||||
return new XYCircle(x, y, radius);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue