IllegalArgumentException: Bound must be positive

前端 未结 2 1093
甜味超标
甜味超标 2020-12-04 01:40

I get an error saying that my bound must be positive. Here is the line I get it on:

inv.setItem(i, items.get(r.nextInt(items.size())));

As

2条回答
  •  暖寄归人
    2020-12-04 02:09

    As far as your stacktrace says,

    java.lang.IllegalArgumentException: bound must be positive at java.util.Random.nextInt(Unknown Source) ~[?:1.8.0_51]

    The argument to nextInt needs to be a positive integer. You will need to find out where you're passing a non-positive input to that method.

提交回复
热议问题