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
@@ -278,7 +278,7 @@ class ScriptTemplateTest {
try {
return if (runIsolated) KotlinToJVMBytecodeCompiler.compileScript(environment, paths)
else KotlinToJVMBytecodeCompiler.compileScript(environment, this.javaClass.classLoader)
else KotlinToJVMBytecodeCompiler.compileScript(environment, this::class.java.classLoader)
}
catch (e: CompilationException) {
messageCollector.report(CompilerMessageSeverity.EXCEPTION, OutputMessageUtil.renderException(e),
@@ -333,15 +333,17 @@ class TestKotlinScriptDependenciesResolver : TestKotlinScriptDummyDependenciesRe
val cp = script.annotations.flatMap {
when (it) {
is DependsOn -> if (it.path == "@{runtime}") listOf(kotlinPaths.runtimePath, kotlinPaths.scriptRuntimePath) else listOf(File(it.path))
is DependsOnTwo -> listOf(it.path1, it.path2).flatMap { it?.let {
when {
it.isBlank() -> emptyList()
it == "@{runtime}" -> listOf(kotlinPaths.runtimePath, kotlinPaths.scriptRuntimePath)
else -> listOf(File(it))
is DependsOnTwo -> listOf(it.path1, it.path2).flatMap {
it.let {
when {
it.isBlank() -> emptyList()
it == "@{runtime}" -> listOf(kotlinPaths.runtimePath, kotlinPaths.scriptRuntimePath)
else -> listOf(File(it))
}
}
}}
}
is InvalidScriptResolverAnnotation -> throw Exception("Invalid annotation ${it.name}", it.error)
else -> throw Exception("Unknown annotation ${it.javaClass}")
else -> throw Exception("Unknown annotation ${it::class.java}")
}
}
return object : KotlinScriptExternalDependencies {