Cleanup: fix some compiler warnings (mostly deprecations, javaClass)

This commit is contained in:
Mikhail Glukhikh
2017-02-21 17:38:43 +03:00
parent d0cc1635db
commit b121bf8802
445 changed files with 773 additions and 949 deletions
@@ -16,7 +16,6 @@
package org.jetbrains.kotlin.utils
import org.jetbrains.kotlin.utils.addToStdlib.check
import org.jetbrains.kotlin.utils.addToStdlib.firstNotNullResult
import kotlin.reflect.*
import kotlin.reflect.full.isSubclassOf
@@ -106,8 +105,8 @@ private fun <T> tryCreateCallableMapping(callable: KCallable<*>, args: Iterator<
}
ArgsTraversalState.NAMED -> {
assert(arg.name != null)
val parIdx = unboundParams.indexOfFirst { it.name == arg.name }.check { it >= 0 }
?: return null // failed to match: no matching named parameter found
val parIdx = unboundParams.indexOfFirst { it.name == arg.name }.takeIf { it >= 0 }
?: return null // failed to match: no matching named parameter found
val par = unboundParams.removeAt(parIdx)
val cvtRes = converter.tryConvertSingle(par, arg)
if (cvtRes is ArgsConverter.Result.Success) {
@@ -184,7 +183,7 @@ private class StringArgsConverter : ArgsConverter<String> {
DoubleArray::class -> args.map { it?.toDoubleOrNull() }
BooleanArray::class -> args.map { it?.toBoolean() }
else -> null
}?.toList()?.check { list -> list.none { it == null } }?.toTypedArray()
}?.toList()?.takeIf { list -> list.none { it == null } }?.toTypedArray()
val parameterType = parameter.type
if (parameterType.jvmErasure.java.isArray) {