Cleanup: fix some compiler warnings (mostly deprecations, javaClass)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user