f19eb20803
#KT-5287 Fixed
12 lines
434 B
Kotlin
12 lines
434 B
Kotlin
package demo
|
|
|
|
object Test {
|
|
fun subListRangeCheck(fromIndex: Int, toIndex: Int, size: Int) {
|
|
if (fromIndex < 0)
|
|
throw IndexOutOfBoundsException("fromIndex = " + fromIndex)
|
|
if (toIndex > size)
|
|
throw IndexOutOfBoundsException("toIndex = " + toIndex)
|
|
if (fromIndex > toIndex)
|
|
throw IllegalArgumentException("fromIndex(" + fromIndex + ") > toIndex(" + toIndex + ")")
|
|
}
|
|
} |