mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
fix code
This commit is contained in:
parent
b184ad79da
commit
50d0569e8c
@ -1294,8 +1294,8 @@ public class NumberUtil {
|
||||
end = temp;
|
||||
}
|
||||
// 加入逻辑判断,确保begin<end并且size不能大于该表示范围
|
||||
Assert.isTrue((end - begin) > size, "Size is larger than range between begin and end!");
|
||||
Assert.isTrue(seed.length > size, "Size is larger than seed size!");
|
||||
Assert.isTrue((end - begin) >= size, "Size is larger than range between begin and end!");
|
||||
Assert.isTrue(seed.length >= size, "Size is larger than seed size!");
|
||||
|
||||
final int[] ranArr = new int[size];
|
||||
// 数量你可以自己定义。
|
||||
|
@ -361,6 +361,7 @@ public class NumberUtilTest {
|
||||
|
||||
@Test
|
||||
public void generateRandomNumberTest2(){
|
||||
// 检查边界
|
||||
final int[] ints = NumberUtil.generateRandomNumber(1, 8, 7);
|
||||
Assert.assertEquals(7, ints.length);
|
||||
final Set<?> set = Convert.convert(Set.class, ints);
|
||||
|
Loading…
Reference in New Issue
Block a user