Compiler&plugin deprecations cleanup: *array -> *arrayOf, copyToArray -> toTypedArray.
This commit is contained in:
@@ -68,7 +68,7 @@ public class JetShortNamesCache(private val project: com.intellij.openapi.projec
|
||||
// Quick check for classes from getAllClassNames()
|
||||
val classOrObjects = org.jetbrains.kotlin.idea.stubindex.JetClassShortNameIndex.getInstance().get(name, project, scope)
|
||||
if (classOrObjects.isEmpty()) {
|
||||
return result.copyToArray()
|
||||
return result.toTypedArray()
|
||||
}
|
||||
|
||||
for (classOrObject in classOrObjects) {
|
||||
@@ -82,7 +82,7 @@ public class JetShortNamesCache(private val project: com.intellij.openapi.projec
|
||||
}
|
||||
}
|
||||
|
||||
return result.copyToArray()
|
||||
return result.toTypedArray()
|
||||
}
|
||||
|
||||
override fun getAllClassNames(dest: HashSet<String>) {
|
||||
@@ -90,29 +90,29 @@ public class JetShortNamesCache(private val project: com.intellij.openapi.projec
|
||||
}
|
||||
|
||||
override fun getMethodsByName(org.jetbrains.annotations.NonNls name: String, scope: com.intellij.psi.search.GlobalSearchScope): Array<PsiMethod>
|
||||
= array()
|
||||
= emptyArray()
|
||||
|
||||
override fun getMethodsByNameIfNotMoreThan(org.jetbrains.annotations.NonNls name: String, scope: com.intellij.psi.search.GlobalSearchScope, maxCount: Int): Array<PsiMethod>
|
||||
= array()
|
||||
= emptyArray()
|
||||
|
||||
override fun getFieldsByNameIfNotMoreThan(org.jetbrains.annotations.NonNls s: String, scope: com.intellij.psi.search.GlobalSearchScope, i: Int): Array<PsiField>
|
||||
= array()
|
||||
= emptyArray()
|
||||
|
||||
override fun processMethodsWithName(org.jetbrains.annotations.NonNls name: String, scope: com.intellij.psi.search.GlobalSearchScope, processor: com.intellij.util.Processor<PsiMethod>): Boolean
|
||||
= com.intellij.util.containers.ContainerUtil.process(getMethodsByName(name, scope), processor)
|
||||
|
||||
override fun getAllMethodNames(): Array<String>
|
||||
= JetFunctionShortNameIndex.getInstance().getAllKeys(project).copyToArray()
|
||||
= JetFunctionShortNameIndex.getInstance().getAllKeys(project).toTypedArray()
|
||||
|
||||
override fun getAllMethodNames(set: HashSet<String>) {
|
||||
set.addAll(JetFunctionShortNameIndex.getInstance().getAllKeys(project))
|
||||
}
|
||||
|
||||
override fun getFieldsByName(org.jetbrains.annotations.NonNls name: String, scope: com.intellij.psi.search.GlobalSearchScope): Array<PsiField>
|
||||
= array()
|
||||
= emptyArray()
|
||||
|
||||
override fun getAllFieldNames(): Array<String>
|
||||
= array()
|
||||
= emptyArray()
|
||||
|
||||
override fun getAllFieldNames(set: HashSet<String>) {
|
||||
}
|
||||
|
||||
@@ -194,11 +194,11 @@ private object NotUnderContentRootModuleInfo : IdeaModuleInfo() {
|
||||
}
|
||||
|
||||
private data class LibraryWithoutSourceScope(project: Project, private val library: Library) :
|
||||
LibraryScopeBase(project, library.getFiles(OrderRootType.CLASSES), array<VirtualFile>()) {
|
||||
LibraryScopeBase(project, library.getFiles(OrderRootType.CLASSES), arrayOf<VirtualFile>()) {
|
||||
}
|
||||
|
||||
//TODO: (module refactoring) android sdk has modified scope
|
||||
private data class SdkScope(project: Project, private val sdk: Sdk) :
|
||||
LibraryScopeBase(project, sdk.getRootProvider().getFiles(OrderRootType.CLASSES), array<VirtualFile>())
|
||||
LibraryScopeBase(project, sdk.getRootProvider().getFiles(OrderRootType.CLASSES), arrayOf<VirtualFile>())
|
||||
|
||||
private fun IdeaModuleInfo.isLibraryClasses() = this is SdkInfo || this is LibraryInfo
|
||||
|
||||
+1
-1
@@ -179,7 +179,7 @@ private class PerFileAnalysisCache(val file: JetFile, val resolveSession: Resolv
|
||||
}
|
||||
|
||||
private object KotlinResolveDataProvider {
|
||||
private val topmostElementTypes = array<Class<out PsiElement?>?>(
|
||||
private val topmostElementTypes = arrayOf<Class<out PsiElement?>?>(
|
||||
javaClass<JetNamedFunction>(),
|
||||
javaClass<JetClassInitializer>(),
|
||||
javaClass<JetProperty>(),
|
||||
|
||||
@@ -238,13 +238,13 @@ public open class JetPsiChecker : Annotator, HighlightRangeExtension {
|
||||
}
|
||||
}
|
||||
|
||||
private fun getBeforeAnalysisVisitors(holder: AnnotationHolder) = array(
|
||||
private fun getBeforeAnalysisVisitors(holder: AnnotationHolder) = arrayOf(
|
||||
SoftKeywordsHighlightingVisitor(holder),
|
||||
LabelsHighlightingVisitor(holder),
|
||||
KDocHighlightingVisitor(holder)
|
||||
)
|
||||
|
||||
private fun getAfterAnalysisVisitor(holder: AnnotationHolder, bindingContext: BindingContext) = array(
|
||||
private fun getAfterAnalysisVisitor(holder: AnnotationHolder, bindingContext: BindingContext) = arrayOf(
|
||||
PropertiesHighlightingVisitor(holder, bindingContext),
|
||||
FunctionsHighlightingVisitor(holder, bindingContext),
|
||||
VariablesHighlightingVisitor(holder, bindingContext),
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ class KotlinSuppressableWarningProblemGroup(
|
||||
if (element == null)
|
||||
return SuppressIntentionAction.EMPTY_ARRAY
|
||||
|
||||
return createSuppressWarningActions(element, diagnosticFactory).copyToArray()
|
||||
return createSuppressWarningActions(element, diagnosticFactory).toTypedArray()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class JetForLoopInReference(element: JetForExpression) : JetMultiReferenc
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val LOOP_RANGE_KEYS = array(
|
||||
private val LOOP_RANGE_KEYS = arrayOf(
|
||||
BindingContext.LOOP_RANGE_ITERATOR_RESOLVED_CALL,
|
||||
BindingContext.LOOP_RANGE_NEXT_RESOLVED_CALL,
|
||||
BindingContext.LOOP_RANGE_HAS_NEXT_RESOLVED_CALL
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ public class JetReferenceContributor() : PsiReferenceContributor() {
|
||||
registerReferenceProvider(PlatformPatterns.psiElement(elementClass), object: PsiReferenceProvider() {
|
||||
override fun getReferencesByElement(element: PsiElement, context: ProcessingContext): Array<PsiReference> {
|
||||
@suppress("UNCHECKED_CAST")
|
||||
return array(factory(element as E))
|
||||
return arrayOf(factory(element as E))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -96,10 +96,10 @@ public class FindImplicitNothingAction : AnAction() {
|
||||
|
||||
SwingUtilities.invokeLater {
|
||||
if (found.isNotEmpty()) {
|
||||
val usages = found.map { UsageInfo2UsageAdapter(UsageInfo(it)) }.copyToArray()
|
||||
val usages = found.map { UsageInfo2UsageAdapter(UsageInfo(it)) }.toTypedArray()
|
||||
val presentation = UsageViewPresentation()
|
||||
presentation.setTabName("Implicit Nothing's")
|
||||
UsageViewManager.getInstance(project).showUsages(array<UsageTarget>(), usages, presentation)
|
||||
UsageViewManager.getInstance(project).showUsages(arrayOf<UsageTarget>(), usages, presentation)
|
||||
}
|
||||
else {
|
||||
Messages.showInfoMessage(project, "Not found in ${files.size()} file(s)", "Not Found")
|
||||
|
||||
@@ -66,7 +66,7 @@ import java.util.ArrayList
|
||||
public class KotlinCopyPasteReferenceProcessor() : CopyPastePostProcessor<KotlinReferenceTransferableData>() {
|
||||
private val LOG = Logger.getInstance(javaClass<KotlinCopyPasteReferenceProcessor>())
|
||||
|
||||
private val IGNORE_REFERENCES_INSIDE: Array<Class<out JetElement>> = array(
|
||||
private val IGNORE_REFERENCES_INSIDE: Array<Class<out JetElement>> = arrayOf(
|
||||
javaClass<JetImportList>(),
|
||||
javaClass<JetPackageDirective>()
|
||||
)
|
||||
@@ -112,7 +112,7 @@ public class KotlinCopyPasteReferenceProcessor() : CopyPastePostProcessor<Kotlin
|
||||
|
||||
if (collectedData.isEmpty()) return listOf()
|
||||
|
||||
return listOf(KotlinReferenceTransferableData(collectedData.copyToArray()))
|
||||
return listOf(KotlinReferenceTransferableData(collectedData.toTypedArray()))
|
||||
}
|
||||
|
||||
public fun collectReferenceData(
|
||||
@@ -334,7 +334,7 @@ public class KotlinCopyPasteReferenceProcessor() : CopyPastePostProcessor<Kotlin
|
||||
return referencesToRestore
|
||||
}
|
||||
|
||||
val dialog = RestoreReferencesDialog(project, fqNames.copyToArray())
|
||||
val dialog = RestoreReferencesDialog(project, fqNames.toTypedArray())
|
||||
dialog.show()
|
||||
|
||||
val selectedFqNames = dialog.getSelectedElements()!!.toSet()
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ import com.intellij.openapi.components.Storage
|
||||
|
||||
State(
|
||||
name = "KotlinCompilerWorkspaceSettings",
|
||||
storages = array(
|
||||
storages = arrayOf(
|
||||
Storage(file = StoragePathMacros.WORKSPACE_FILE)
|
||||
)
|
||||
)
|
||||
|
||||
+2
-2
@@ -102,7 +102,7 @@ public class ConvertJavaCopyPastePostProcessor : CopyPastePostProcessor<TextBloc
|
||||
}
|
||||
}
|
||||
|
||||
KotlinCopyPasteReferenceProcessor().processReferenceData(project, targetFile, bounds.start, referenceData.copyToArray())
|
||||
KotlinCopyPasteReferenceProcessor().processReferenceData(project, targetFile, bounds.start, referenceData.toTypedArray())
|
||||
|
||||
return rangeMarker.range
|
||||
}
|
||||
@@ -221,7 +221,7 @@ public class ConvertJavaCopyPastePostProcessor : CopyPastePostProcessor<TextBloc
|
||||
|
||||
val dummyFile = JetPsiFactory(targetFile.getProject()).createAnalyzableFile("dummy.kt", fileText, targetFile)
|
||||
|
||||
return KotlinCopyPasteReferenceProcessor().collectReferenceData(dummyFile, intArray(blockStart!!), intArray(blockEnd!!))
|
||||
return KotlinCopyPasteReferenceProcessor().collectReferenceData(dummyFile, intArrayOf(blockStart!!), intArrayOf(blockEnd!!))
|
||||
}
|
||||
|
||||
private fun generateDummyFunctionName(convertedCode: String): String {
|
||||
|
||||
@@ -29,7 +29,7 @@ import com.intellij.xdebugger.settings.XDebuggerSettings
|
||||
|
||||
import com.intellij.xdebugger.XDebuggerUtil
|
||||
|
||||
State(name = "KotlinDebuggerSettings", storages = array(Storage(file = StoragePathMacros.APP_CONFIG + "/kotlin_debug.xml")))
|
||||
State(name = "KotlinDebuggerSettings", storages = arrayOf(Storage(file = StoragePathMacros.APP_CONFIG + "/kotlin_debug.xml")))
|
||||
public class KotlinDebuggerSettings : XDebuggerSettings<KotlinDebuggerSettings>("kotlin_debugger"), Getter<KotlinDebuggerSettings> {
|
||||
public var DEBUG_RENDER_DELEGATED_PROPERTIES: Boolean = true
|
||||
public var DEBUG_DISABLE_KOTLIN_INTERNAL_CLASSES: Boolean = true
|
||||
|
||||
@@ -25,7 +25,7 @@ private val KOTLIN_STDLIB_FILTER = "kotlin.*"
|
||||
public fun addKotlinStdlibDebugFilterIfNeeded() {
|
||||
if (!KotlinDebuggerSettings.getInstance().DEBUG_IS_FILTER_FOR_STDLIB_ALREADY_ADDED) {
|
||||
val settings = DebuggerSettings.getInstance()!!
|
||||
val newFilters = (settings.getSteppingFilters() + ClassFilter(KOTLIN_STDLIB_FILTER)).copyToArray()
|
||||
val newFilters = (settings.getSteppingFilters() + ClassFilter(KOTLIN_STDLIB_FILTER)).toTypedArray()
|
||||
|
||||
settings.setSteppingFilters(newFilters)
|
||||
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ class DelegatingFindMemberUsagesHandler(
|
||||
KotlinFindMemberUsagesHandler.getInstance(element, elementsToSearch, factory)
|
||||
|
||||
is PsiMethod ->
|
||||
JavaFindUsagesHandler(element, elementsToSearch.copyToArray(), factory.javaHandlerFactory)
|
||||
JavaFindUsagesHandler(element, elementsToSearch.toTypedArray(), factory.javaHandlerFactory)
|
||||
|
||||
else -> null
|
||||
}
|
||||
|
||||
@@ -27,11 +27,11 @@ public class KotlinTemplatesFactory : ProjectTemplatesFactory() {
|
||||
public val KOTLIN_GROUP_NAME: String = "Kotlin"
|
||||
}
|
||||
|
||||
override fun getGroups() = array(KOTLIN_GROUP_NAME)
|
||||
override fun getGroups() = arrayOf(KOTLIN_GROUP_NAME)
|
||||
override fun getGroupIcon(group: String) = JetIcons.SMALL_LOGO
|
||||
|
||||
override fun createTemplates(group: String, context: WizardContext?) =
|
||||
array(
|
||||
arrayOf(
|
||||
BuilderBasedTemplate(KotlinModuleBuilder(TargetPlatform.JVM, "Kotlin - JVM", "Kotlin module for JVM target")),
|
||||
BuilderBasedTemplate(KotlinModuleBuilder(TargetPlatform.JS, "Kotlin - JavaScript", "Kotlin module for JavaScript target"))
|
||||
)
|
||||
|
||||
+1
-1
@@ -41,6 +41,6 @@ class KotlinOverrideTreeStructure(project: Project, val element: PsiElement) : H
|
||||
return javaTreeStructures
|
||||
.stream()
|
||||
.map (::buildChildrenByTreeStructure)
|
||||
.reduce { a, b -> ContainerUtil.union(a.toSet(), b.toSet()).copyToArray() }
|
||||
.reduce { a, b -> ContainerUtil.union(a.toSet(), b.toSet()).toTypedArray() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ public fun navigateToOverriddenMethod(e: MouseEvent?, method: PsiMethod) {
|
||||
var overridingJavaMethods = processor.getCollection().filter { it !is KotlinLightMethodForTraitFakeOverride }
|
||||
if (overridingJavaMethods.isEmpty()) return
|
||||
|
||||
val showMethodNames = !PsiUtil.allMethodsHaveSameSignature(overridingJavaMethods.copyToArray())
|
||||
val showMethodNames = !PsiUtil.allMethodsHaveSameSignature(overridingJavaMethods.toTypedArray())
|
||||
|
||||
val renderer = MethodCellRenderer(showMethodNames)
|
||||
overridingJavaMethods = overridingJavaMethods.sortBy(renderer.getComparator())
|
||||
@@ -114,7 +114,7 @@ public fun navigateToOverriddenMethod(e: MouseEvent?, method: PsiMethod) {
|
||||
val methodsUpdater = OverridingMethodsUpdater(method, renderer)
|
||||
PsiElementListNavigator.openTargets(
|
||||
e,
|
||||
overridingJavaMethods.copyToArray(),
|
||||
overridingJavaMethods.toTypedArray(),
|
||||
methodsUpdater.getCaption(overridingJavaMethods.size()),
|
||||
"Overriding declarations of " + method.getName(),
|
||||
renderer,
|
||||
|
||||
@@ -109,7 +109,7 @@ fun navigateToPropertyOverriddenDeclarations(e: MouseEvent?, property: JetProper
|
||||
.filterIsInstance<NavigatablePsiElement>()
|
||||
|
||||
PsiElementListNavigator.openTargets(e,
|
||||
navigatingOverrides.copyToArray(),
|
||||
navigatingOverrides.toTypedArray(),
|
||||
JetBundle.message("navigation.title.overriding.property", property.getName()),
|
||||
JetBundle.message("navigation.findUsages.title.overriding.property", property.getName()), renderer)
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ public class SuperDeclarationMarkerNavigationHandler : GutterIconNavigationHandl
|
||||
|
||||
PsiElementListNavigator.openTargets(
|
||||
e,
|
||||
superDeclarations.copyToArray(),
|
||||
superDeclarations.toTypedArray(),
|
||||
JetBundle.message("navigation.title.super.declaration", elementName),
|
||||
JetBundle.message("navigation.findUsages.title.super.declaration", elementName),
|
||||
JetFunctionPsiElementCellRenderer())
|
||||
|
||||
@@ -86,7 +86,7 @@ public class ReflectionNotFoundInspection : AbstractKotlinInspection() {
|
||||
expression.getDoubleColonTokenReference(),
|
||||
JetBundle.message("reflection.not.found"),
|
||||
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
|
||||
*(createQuickFix().singletonOrEmptyList().copyToArray())
|
||||
*(createQuickFix().singletonOrEmptyList().toTypedArray())
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ public class UnusedSymbolInspection : AbstractKotlinInspection() {
|
||||
|
||||
override fun applyFix(project: Project, descriptor: ProblemDescriptor?) {
|
||||
if (!FileModificationService.getInstance().prepareFileForWrite(declaration.getContainingFile())) return
|
||||
SafeDeleteHandler.invoke(project, array(declaration), false)
|
||||
SafeDeleteHandler.invoke(project, arrayOf(declaration), false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ public abstract class CallableRefactoring<T: CallableDescriptor>(
|
||||
"refactor")
|
||||
val title = IdeBundle.message("title.warning")!!
|
||||
val icon = Messages.getQuestionIcon()!!
|
||||
return Messages.showDialog(message, title, options.copyToArray(), 0, icon)
|
||||
return Messages.showDialog(message, title, options.toTypedArray(), 0, icon)
|
||||
}
|
||||
|
||||
protected fun checkModifiable(element: PsiElement): Boolean {
|
||||
|
||||
@@ -98,7 +98,7 @@ public class JetChangeInfo(
|
||||
|
||||
public fun getNewParametersCount(): Int = newParameters.size()
|
||||
|
||||
override fun getNewParameters(): Array<JetParameterInfo> = newParameters.copyToArray()
|
||||
override fun getNewParameters(): Array<JetParameterInfo> = newParameters.toTypedArray()
|
||||
|
||||
fun getNonReceiverParametersCount(): Int = newParameters.size() - (if (receiverParameterInfo != null) 1 else 0)
|
||||
|
||||
@@ -255,7 +255,7 @@ public class JetChangeInfo(
|
||||
}
|
||||
|
||||
ParameterInfoImpl(javaOldIndex, info.getName(), type, info.defaultValueForCall?.getText() ?: "")
|
||||
}.copyToArray()
|
||||
}.toTypedArray()
|
||||
|
||||
val returnType = if (isPrimaryMethodUpdated) currentPsiMethod.getReturnType() else PsiType.VOID
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ import com.intellij.usageView.UsageViewBundle
|
||||
import com.intellij.usageView.UsageViewDescriptor
|
||||
|
||||
public class JetUsagesViewDescriptor(private val element: PsiElement, private val elementsHeader: String) : UsageViewDescriptor {
|
||||
override fun getElements(): Array<PsiElement> = array(element)
|
||||
override fun getElements(): Array<PsiElement> = arrayOf(element)
|
||||
|
||||
override fun getProcessedElementsHeader(): String = elementsHeader
|
||||
|
||||
|
||||
+1
-1
@@ -202,7 +202,7 @@ abstract class OutputValueBoxer(val outputValues: List<OutputValue>) {
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val selectors = array("first", "second", "third")
|
||||
private val selectors = arrayOf("first", "second", "third")
|
||||
}
|
||||
|
||||
override val returnType: JetType by Delegates.lazy {
|
||||
|
||||
+2
-2
@@ -77,14 +77,14 @@ public class KotlinIntroduceParameterDialog private constructor(
|
||||
editor,
|
||||
introduceParameterDescriptor,
|
||||
lambdaExtractionDescriptor,
|
||||
lambdaExtractionDescriptor.suggestedNames.copyToArray(),
|
||||
lambdaExtractionDescriptor.suggestedNames.toTypedArray(),
|
||||
listOf(lambdaExtractionDescriptor.returnType),
|
||||
helper
|
||||
)
|
||||
|
||||
private val typeNameSuggestions = typeSuggestions
|
||||
.map { IdeDescriptorRenderers.SOURCE_CODE_SHORT_NAMES_IN_TYPES.renderType(it) }
|
||||
.copyToArray()
|
||||
.toTypedArray()
|
||||
|
||||
private val nameField = NameSuggestionsField(nameSuggestions, project, JetFileType.INSTANCE)
|
||||
private val typeField = NameSuggestionsField(typeNameSuggestions, project, JetFileType.INSTANCE)
|
||||
|
||||
+1
-1
@@ -311,7 +311,7 @@ public open class KotlinIntroduceParameterHandler(
|
||||
KotlinIntroduceParameterDialog(project,
|
||||
editor,
|
||||
introduceParameterDescriptor,
|
||||
suggestedNames.copyToArray(),
|
||||
suggestedNames.toTypedArray(),
|
||||
listOf(replacementType) + replacementType.supertypes(),
|
||||
helper).show()
|
||||
}
|
||||
|
||||
+1
-1
@@ -94,7 +94,7 @@ public class KotlinInplacePropertyIntroducer(
|
||||
if (availableTargets.size() > 1) {
|
||||
addPanelControl(
|
||||
ControlWrapper {
|
||||
val propertyKindComboBox = with(JComboBox(availableTargets.map { it.name.capitalize() }.copyToArray())) {
|
||||
val propertyKindComboBox = with(JComboBox(availableTargets.map { it.name.capitalize() }.toTypedArray())) {
|
||||
addPopupMenuListener(
|
||||
object : PopupMenuListenerAdapter() {
|
||||
override fun popupMenuWillBecomeInvisible(e: PopupMenuEvent?) {
|
||||
|
||||
+3
-3
@@ -120,15 +120,15 @@ public class RenameKotlinPropertyProcessor : RenamePsiElementProcessor() {
|
||||
}
|
||||
|
||||
super.renameElement(element, PropertyCodegen.setterName(Name.identifier(newName!!)),
|
||||
refKindUsages[UsageKind.SETTER_USAGE]?.copyToArray() ?: array<UsageInfo>(),
|
||||
refKindUsages[UsageKind.SETTER_USAGE]?.toTypedArray() ?: arrayOf<UsageInfo>(),
|
||||
null)
|
||||
|
||||
super.renameElement(element, PropertyCodegen.getterName(Name.identifier(newName)),
|
||||
refKindUsages[UsageKind.GETTER_USAGE]?.copyToArray() ?: array<UsageInfo>(),
|
||||
refKindUsages[UsageKind.GETTER_USAGE]?.toTypedArray() ?: arrayOf<UsageInfo>(),
|
||||
null)
|
||||
|
||||
super.renameElement(element, newName,
|
||||
refKindUsages[UsageKind.SIMPLE_PROPERTY_USAGE]?.copyToArray() ?: array<UsageInfo>(),
|
||||
refKindUsages[UsageKind.SIMPLE_PROPERTY_USAGE]?.toTypedArray() ?: arrayOf<UsageInfo>(),
|
||||
null)
|
||||
|
||||
listener?.elementRenamed(element)
|
||||
|
||||
+1
-1
@@ -277,7 +277,7 @@ public class KotlinSafeDeleteProcessor : JavaSafeDeleteProcessor() {
|
||||
}
|
||||
}
|
||||
|
||||
return result.copyToArray()
|
||||
return result.toTypedArray()
|
||||
}
|
||||
|
||||
override fun prepareForDeletion(element: PsiElement) {
|
||||
|
||||
@@ -23,9 +23,9 @@ import com.intellij.diagnostic.AttachmentFactory
|
||||
public fun attachmentByPsiFileAsArray(file: PsiFile?): Array<Attachment> {
|
||||
val attachment = attachmentByPsiFile(file)
|
||||
if (attachment == null) {
|
||||
return array()
|
||||
return arrayOf()
|
||||
}
|
||||
return array(attachment)
|
||||
return arrayOf(attachment)
|
||||
}
|
||||
|
||||
public fun attachmentByPsiFile(file: PsiFile?): Attachment? {
|
||||
|
||||
+1
-1
@@ -249,7 +249,7 @@ public abstract class AbstractJetExtractionTest() : JetLightCodeInsightFixtureTe
|
||||
val extractionOptions = InTextDirectivesUtils.findListWithPrefixes(fileText, "// OPTIONS: ").let {
|
||||
if (it.isNotEmpty()) {
|
||||
@suppress("CAST_NEVER_SUCCEEDS")
|
||||
val args = it.map { it.toBoolean() }.copyToArray() as Array<Any?>
|
||||
val args = it.map { it.toBoolean() }.toTypedArray() as Array<Any?>
|
||||
javaClass<ExtractionOptions>().getConstructors().first { it.getParameterTypes().size() == args.size() }.newInstance(*args) as ExtractionOptions
|
||||
} else ExtractionOptions.DEFAULT
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ enum class MoveAction {
|
||||
val targetClassName = config.getString("targetClass")
|
||||
val visibility = config.getNullableString("visibility")
|
||||
|
||||
val options = MockMoveMembersOptions(targetClassName, array(member))
|
||||
val options = MockMoveMembersOptions(targetClassName, arrayOf(member))
|
||||
if (visibility != null) {
|
||||
options.setMemberVisibility(visibility)
|
||||
}
|
||||
@@ -145,7 +145,7 @@ enum class MoveAction {
|
||||
|
||||
MoveClassesOrPackagesProcessor(
|
||||
mainFile.getProject(),
|
||||
array(classToMove),
|
||||
arrayOf(classToMove),
|
||||
MultipleRootsMoveDestination(PackageWrapper(mainFile.getManager(), targetPackage)),
|
||||
/* searchInComments = */ false,
|
||||
/* searchInNonJavaFiles = */ true,
|
||||
@@ -162,7 +162,7 @@ enum class MoveAction {
|
||||
|
||||
MoveClassesOrPackagesProcessor(
|
||||
project,
|
||||
array(JavaPsiFacade.getInstance(project).findPackage(sourcePackage)!!),
|
||||
arrayOf(JavaPsiFacade.getInstance(project).findPackage(sourcePackage)!!),
|
||||
MultipleRootsMoveDestination(PackageWrapper(mainFile.getManager(), targetPackage)),
|
||||
/* searchInComments = */ false,
|
||||
/* searchInNonJavaFiles = */ true,
|
||||
@@ -180,7 +180,7 @@ enum class MoveAction {
|
||||
|
||||
MoveClassToInnerProcessor(
|
||||
project,
|
||||
array(classToMove),
|
||||
arrayOf(classToMove),
|
||||
JavaPsiFacade.getInstance(project).findClass(targetClass, project.allScope())!!,
|
||||
/* searchInComments = */ false,
|
||||
/* searchInNonJavaFiles = */ true,
|
||||
@@ -218,7 +218,7 @@ enum class MoveAction {
|
||||
ActionRunner.runInsideWriteAction { VfsUtil.createDirectoryIfMissing(rootDir, targetPackage.replace('.', '/')) }
|
||||
MoveFilesOrDirectoriesProcessor(
|
||||
project,
|
||||
array(mainFile),
|
||||
arrayOf(mainFile),
|
||||
JavaPsiFacade.getInstance(project).findPackage(targetPackage)!!.getDirectories()[0],
|
||||
/* searchInComments = */ false,
|
||||
/* searchInNonJavaFiles = */ true,
|
||||
@@ -231,7 +231,7 @@ enum class MoveAction {
|
||||
|
||||
MoveHandler.doMove(
|
||||
project,
|
||||
array(mainFile),
|
||||
arrayOf(mainFile),
|
||||
PsiManager.getInstance(project).findFile(rootDir.findFileByRelativePath(targetFile)!!)!!,
|
||||
/* dataContext = */ null,
|
||||
/* callback = */ null
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ public abstract class AbstractKotlinFileStructureTest : JetLightCodeInsightFixtu
|
||||
|
||||
popup.setup()
|
||||
|
||||
val printInfo = PrintInfo(array("text"), array("location"))
|
||||
val printInfo = PrintInfo(arrayOf("text"), arrayOf("location"))
|
||||
val popupText = StructureViewUtil.print(popup.getTree(), false, printInfo, null)
|
||||
JetTestUtils.assertEqualsToFile(File("${FileUtil.getNameWithoutExtension(path)}.after"), popupText)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user