Cleanup: fix some compiler warnings (mostly deprecations, javaClass)
This commit is contained in:
+1
-1
@@ -47,7 +47,7 @@ class AndroidXmlVisitor(val elementCallback: (ResourceIdentifier, String, XmlAtt
|
||||
if (idAttribute != null) {
|
||||
val idAttributeValue = idAttribute.value
|
||||
if (idAttributeValue != null) {
|
||||
val xmlType = tag?.getAttribute(AndroidConst.CLASS_ATTRIBUTE_NO_NAMESPACE)?.value ?: localName
|
||||
val xmlType = tag.getAttribute(AndroidConst.CLASS_ATTRIBUTE_NO_NAMESPACE)?.value ?: localName
|
||||
val name = androidIdToName(idAttributeValue)
|
||||
if (name != null) elementCallback(name, xmlType, idAttribute)
|
||||
}
|
||||
|
||||
+2
-2
@@ -83,7 +83,7 @@ class IDEAndroidLayoutXmlFileManager(val module: Module) : AndroidLayoutXmlFileM
|
||||
val propertyName = propertyDescriptor.name.asString()
|
||||
|
||||
val attributes = arrayListOf<PsiElement>()
|
||||
val visitor = AndroidXmlVisitor { retId, wClass, valueElement ->
|
||||
val visitor = AndroidXmlVisitor { retId, _, valueElement ->
|
||||
if (retId.name == propertyName) attributes.add(valueElement)
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ class IDEAndroidLayoutXmlFileManager(val module: Module) : AndroidLayoutXmlFileM
|
||||
if (applicationPackage != null) {
|
||||
val mainVariant = mainSourceProvider.toVariant()
|
||||
|
||||
val method = try { javaClass.getMethod("getFlavorSourceProviders") } catch (e: NoSuchMethodException) { null }
|
||||
val method = try { this::class.java.getMethod("getFlavorSourceProviders") } catch (e: NoSuchMethodException) { null }
|
||||
val variants: List<AndroidVariant>? = if (method != null) {
|
||||
val sourceProviders = method.invoke(this) as List<SourceProvider>?
|
||||
sourceProviders?.map { it.toVariant() } ?: listOf()
|
||||
|
||||
Reference in New Issue
Block a user