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
@@ -87,7 +87,7 @@ class KotlinUastLanguagePlugin : UastLanguagePlugin {
val resultingDescriptor = resolvedCall.resultingDescriptor
if (resultingDescriptor !is FunctionDescriptor || resultingDescriptor.name.asString() != methodName) return null
val parent = element.parent ?: return null
val parent = element.parent
val parentUElement = convertElementWithParent(parent, null) ?: return null
val uExpression = KotlinUFunctionCallExpression(element, parentUElement, resolvedCall)
@@ -46,7 +46,7 @@ class UastKotlinPsiParameter(
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
return ktParameter == (other as? UastKotlinPsiParameter)?.ktParameter
}
@@ -32,7 +32,7 @@ class UastKotlinPsiVariable(
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
return ktElement == (other as? UastKotlinPsiVariable)?.ktElement
}
@@ -15,7 +15,7 @@ class KotlinUastApiTest : AbstractKotlinUastTest() {
}
@Test fun testAnnotationParameters() {
doTest("AnnotationParameters") { name, file ->
doTest("AnnotationParameters") { _, file ->
val annotation = file.findElementByText<UAnnotation>("@IntRange(from = 10, to = 0)")
assertEquals(annotation.findAttributeValue("from")?.evaluate(), 10)
assertEquals(annotation.findAttributeValue("to")?.evaluate(), 0)
@@ -23,7 +23,7 @@ class KotlinUastApiTest : AbstractKotlinUastTest() {
}
@Test fun testConvertStringTemplate() {
doTest("StringTemplateInClass") { name, file ->
doTest("StringTemplateInClass") { _, file ->
val literalExpression = file.findElementByText<ULiteralExpression>("lorem")
val psi = literalExpression.psi!!
Assert.assertTrue(psi is KtLiteralStringTemplateEntry)