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
@@ -202,7 +202,7 @@ abstract class AbstractAnnotationProcessingExtension(
private fun KotlinProcessingEnvironment.doAnnotationProcessing(files: Collection<KtFile>): ProcessingResult {
run initializeProcessors@ {
processors().forEach { it.init(this) }
log { "Initialized processors: " + processors().joinToString { it.javaClass.name } }
log { "Initialized processors: " + processors().joinToString { it::class.java.name } }
}
val firstRoundAnnotations = RoundAnnotations(
@@ -334,7 +334,7 @@ abstract class AbstractAnnotationProcessingExtension(
}
if (applicableAnnotationNames.isEmpty()) {
log { "Skipping processor " + processor.javaClass.name + ": no relevant annotations" }
log { "Skipping processor " + processor::class.java.name + ": no relevant annotations" }
continue
}
@@ -344,7 +344,7 @@ abstract class AbstractAnnotationProcessingExtension(
log {
val annotationNames = applicableAnnotations.joinToString { it.qualifiedName.toString() }
"Processing with " + processor.javaClass.name + " (annotations: " + annotationNames + ")"
"Processing with " + processor::class.java.name + " (annotations: " + annotationNames + ")"
}
processor.process(applicableAnnotations, roundEnvironment)
@@ -92,7 +92,7 @@ class KotlinElements(
override fun printElements(w: Writer, vararg elements: Element) {
val printWriter = PrintWriter(w)
for (element in elements) {
printWriter.println(element.simpleName.toString() + " (" + element.javaClass.name + ")")
printWriter.println(element.simpleName.toString() + " (" + element::class.java.name + ")")
}
}
@@ -177,7 +177,7 @@ object Constants {
is Int, is Boolean -> value.toString()
else -> throw IllegalArgumentException(
"Argument is not a primitive type or a string; it " +
(if (value == null) "is a null value." else "has class " + value.javaClass.name) + ".")
(if (value == null) "is a null value." else "has class " + value::class.java.name) + ".")
}
}
@@ -267,7 +267,7 @@ class KotlinTypes(
}
is JeVariableElement -> substitutor.substitute(element.psi.type).toJeType(psiManager())
is JeTypeParameterElement -> substitutor.substitute(element.psi)?.toJeType(psiManager()) ?: element.asType()
else -> throw IllegalArgumentException("Invalid element type: ${element.javaClass.name} ($element)")
else -> throw IllegalArgumentException("Invalid element type: ${element::class.java.name} ($element)")
}
}
@@ -308,6 +308,6 @@ private fun assertKindNot(typeMirror: TypeMirror, vararg kinds: TypeKind): Unit
private fun assertJeType(type: TypeMirror) {
if (type !is JeTypeMirror) {
illegalArg("Must be a subclass of JePsiType, got ${type.javaClass.name}")
illegalArg("Must be a subclass of JePsiType, got ${type::class.java.name}")
}
}