From 527e379480ad370c9283bc2b782a130efd783b58 Mon Sep 17 00:00:00 2001 From: Sergey Lukjanov Date: Fri, 16 Mar 2012 13:07:26 +0400 Subject: [PATCH] Arrays.copyOf() and .copyOfRange() should return not nullable result --- libraries/stdlib/src/Arrays.kt | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/libraries/stdlib/src/Arrays.kt b/libraries/stdlib/src/Arrays.kt index ba857153dcb..422b5bcce65 100644 --- a/libraries/stdlib/src/Arrays.kt +++ b/libraries/stdlib/src/Arrays.kt @@ -75,25 +75,25 @@ inline fun FloatArray.sort(fromIndex: Int, toIndex: Int) = Arrays.sort(this, fr inline fun DoubleArray.sort(fromIndex: Int, toIndex: Int) = Arrays.sort(this, fromIndex, toIndex) inline fun CharArray.sort(fromIndex: Int, toIndex: Int) = Arrays.sort(this, fromIndex, toIndex) -inline fun BooleanArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength) -inline fun ByteArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength) -inline fun ShortArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength) -inline fun IntArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength) -inline fun LongArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength) -inline fun FloatArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength) -inline fun DoubleArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength) -inline fun CharArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength) +inline fun BooleanArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength).sure() +inline fun ByteArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength).sure() +inline fun ShortArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength).sure() +inline fun IntArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength).sure() +inline fun LongArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength).sure() +inline fun FloatArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength).sure() +inline fun DoubleArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength).sure() +inline fun CharArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength).sure() inline fun Array.copyOf(newLength: Int = this.size) : Array = Arrays.copyOf(this, newLength).sure() -inline fun BooleanArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to) -inline fun ByteArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to) -inline fun ShortArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to) -inline fun IntArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to) -inline fun LongArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to) -inline fun FloatArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to) -inline fun DoubleArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to) -inline fun CharArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to) +inline fun BooleanArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to).sure() +inline fun ByteArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to).sure() +inline fun ShortArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to).sure() +inline fun IntArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to).sure() +inline fun LongArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to).sure() +inline fun FloatArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to).sure() +inline fun DoubleArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to).sure() +inline fun CharArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to).sure() inline fun Array.copyOfRange(from: Int, to: Int) : Array = Arrays.copyOfRange(this, from, to).sure()