Compiler&plugin deprecations cleanup: *array -> *arrayOf, copyToArray -> toTypedArray.
This commit is contained in:
+1
-1
@@ -37,7 +37,7 @@ public object AndroidConst {
|
||||
|
||||
val ID_DECLARATION_PREFIX = "@+id/"
|
||||
val ID_USAGE_PREFIX = "@id/"
|
||||
val XML_ID_PREFIXES = array(ID_DECLARATION_PREFIX, ID_USAGE_PREFIX)
|
||||
val XML_ID_PREFIXES = arrayOf(ID_DECLARATION_PREFIX, ID_USAGE_PREFIX)
|
||||
|
||||
val CLEAR_FUNCTION_NAME = "clearFindViewByIdCache"
|
||||
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ public abstract class AndroidResourceManager(val project: Project) {
|
||||
|
||||
fun VirtualFile.getAllChildren(): List<VirtualFile> {
|
||||
val allChildren = arrayListOf<VirtualFile>()
|
||||
val currentChildren = getChildren() ?: array()
|
||||
val currentChildren = getChildren() ?: emptyArray()
|
||||
for (child in currentChildren) {
|
||||
if (child.isDirectory()) {
|
||||
allChildren.addAll(child.getAllChildren())
|
||||
|
||||
+2
-2
@@ -60,7 +60,7 @@ class AndroidFindMemberUsagesHandler(
|
||||
|
||||
val psiElements = parser?.resourceManager?.propertyToXmlAttributes(property)
|
||||
val valueElements = psiElements?.map { (it as? XmlAttribute)?.getValueElement() as? PsiElement }?.filterNotNull()
|
||||
if (valueElements != null && valueElements.isNotEmpty()) return valueElements.copyToArray()
|
||||
if (valueElements != null && valueElements.isNotEmpty()) return valueElements.toTypedArray()
|
||||
|
||||
return super.getPrimaryElements()
|
||||
}
|
||||
@@ -89,7 +89,7 @@ class AndroidFindMemberUsagesHandler(
|
||||
}
|
||||
}
|
||||
|
||||
if (res.isNotEmpty()) return res.copyToArray()
|
||||
if (res.isNotEmpty()) return res.toTypedArray()
|
||||
|
||||
return super.getSecondaryElements()
|
||||
}
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ public class AndroidGotoDeclarationHandler : GotoDeclarationHandler {
|
||||
val parser = ModuleServiceManager.getService(moduleInfo.module, javaClass<AndroidUIXmlProcessor>())
|
||||
val psiElements = parser.resourceManager.propertyToXmlAttributes(property)
|
||||
val valueElements = psiElements.map { (it as? XmlAttribute)?.getValueElement() as? PsiElement }.filterNotNull()
|
||||
if (valueElements.isNotEmpty()) return valueElements.copyToArray()
|
||||
if (valueElements.isNotEmpty()) return valueElements.toTypedArray()
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user