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
@@ -274,12 +274,9 @@ class IncrementalJvmCompilerRunner(
// there is no point in updating annotation file since all files will be compiled anyway
kaptAnnotationsFileUpdater = null
}
else -> throw IllegalStateException("Unknown CompilationMode ${compilationMode.javaClass}")
else -> throw IllegalStateException("Unknown CompilationMode ${compilationMode::class.java}")
}
@Suppress("NAME_SHADOWING")
var compilationMode = compilationMode
val currentBuildInfo = BuildInfo(startTS = System.currentTimeMillis())
BuildInfo.write(currentBuildInfo, lastBuildInfoFile)
val buildDirtyLookupSymbols = HashSet<LookupSymbol>()
@@ -356,7 +353,7 @@ class IncrementalJvmCompilerRunner(
changesRegistry.registerChanges(currentBuildInfo.startTS, dirtyData)
}
else {
assert(compilationMode is CompilationMode.Rebuild) { "Unexpected compilation mode: ${compilationMode.javaClass}" }
assert(compilationMode is CompilationMode.Rebuild) { "Unexpected compilation mode: ${compilationMode::class.java}" }
changesRegistry.unknownChanges(currentBuildInfo.startTS)
}
}
@@ -400,7 +397,6 @@ class IncrementalJvmCompilerRunner(
KotlinClassHeader.Kind.MULTIFILE_CLASS_PART -> {
result.addAll(partsByFacadeName(outputClass.classHeader.multifileClassName!!))
}
}
}
@@ -30,7 +30,7 @@ class FileSnapshot(
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other?.javaClass != javaClass) return false
if (other == null || other::class.java != this::class.java) return false
other as FileSnapshot
@@ -28,7 +28,7 @@ abstract class TestWithWorkingDir {
@Before
open fun setUp() {
workingDir = FileUtil.createTempDirectory(this.javaClass.simpleName, null)
workingDir = FileUtil.createTempDirectory(this::class.java.simpleName, null)
}
@After
@@ -81,7 +81,7 @@ class KotlinStandaloneIncrementalCompilationTest : TestWithWorkingDir() {
var step = 1
for ((modificationStep, buildLogStep) in modifications.zip(buildLogSteps)) {
modificationStep.forEach { it.perform(workingDir, mapWorkingToOriginalFile) }
val (exitCode, compiledSources, compileErrors) = make(cacheDir, sourceRoots, args)
val (_, compiledSources, compileErrors) = make(cacheDir, sourceRoots, args)
expectedSB.appendLine(stepLogAsString(step, buildLogStep.compiledKotlinFiles, buildLogStep.compileErrors))
expectedSBWithoutErrors.appendLine(stepLogAsString(step, buildLogStep.compiledKotlinFiles, buildLogStep.compileErrors, includeErrors = false))