diff --git a/platform/build-scripts/src/org/jetbrains/intellij/build/classpath.kt b/platform/build-scripts/src/org/jetbrains/intellij/build/classpath.kt index 9728347787db..11cd8dd062d2 100644 --- a/platform/build-scripts/src/org/jetbrains/intellij/build/classpath.kt +++ b/platform/build-scripts/src/org/jetbrains/intellij/build/classpath.kt @@ -34,7 +34,7 @@ internal suspend fun generateClasspath(context: BuildContext): List { val excluded = excludedLibJars(context) val existing = HashSet() Files.newDirectoryStream(libDir).use { stream -> - stream.asSequence().filterTo(existing) { it.toString().endsWith(".jar") && !excluded.contains(it.fileName.toString()) } + stream.filterTo(existing) { it.toString().endsWith(".jar") && !excluded.contains(it.fileName.toString()) } } val result = computeAppClassPath(libDir, existing).map { libDir.relativize(it).toString() } span.setAttribute(AttributeKey.stringArrayKey("result"), result) diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/collectors/fus/fileTypes/FileTypeUsageCounterCollector.kt b/platform/platform-impl/src/com/intellij/internal/statistic/collectors/fus/fileTypes/FileTypeUsageCounterCollector.kt index a6caf69c3998..ea54ed8e9411 100644 --- a/platform/platform-impl/src/com/intellij/internal/statistic/collectors/fus/fileTypes/FileTypeUsageCounterCollector.kt +++ b/platform/platform-impl/src/com/intellij/internal/statistic/collectors/fus/fileTypes/FileTypeUsageCounterCollector.kt @@ -209,7 +209,7 @@ object FileTypeUsageCounterCollector : CounterUsagesCollector() { return } val fileNameMatchers = fileTypeManager.getStandardMatchers(fileType) - fileNameMatchers.asSequence() + fileNameMatchers .firstOrNull { it.acceptsCharSequence(file.getName()) } ?.let { data.add(FILE_NAME_PATTERN_FIELD.with(it.getPresentableString())) diff --git a/platform/searchEverywhere/frontend/src/ui/SeResultListModel.kt b/platform/searchEverywhere/frontend/src/ui/SeResultListModel.kt index 0393d8b8315b..e6aadb9b57b7 100644 --- a/platform/searchEverywhere/frontend/src/ui/SeResultListModel.kt +++ b/platform/searchEverywhere/frontend/src/ui/SeResultListModel.kt @@ -63,7 +63,7 @@ class SeResultListModel: DefaultListModel() { private fun firstIndexOrNull(fullSearch: Boolean, predicate: (SeItemData) -> Boolean): Int? { val startIndex = if (fullSearch || ignoreFreezing) 0 else frozenCount - return (startIndex until size).asSequence().firstOrNull { index -> + return (startIndex until size).firstOrNull { index -> when (val row = getElementAt(index)) { is SeResultListItemRow -> { predicate(row.item) diff --git a/plugins/devkit/intellij.devkit.workspaceModel/k2/src/metaModel/WorkspaceMetaModelBuilder.kt b/plugins/devkit/intellij.devkit.workspaceModel/k2/src/metaModel/WorkspaceMetaModelBuilder.kt index 6746ef098b93..d40d550c24a4 100644 --- a/plugins/devkit/intellij.devkit.workspaceModel/k2/src/metaModel/WorkspaceMetaModelBuilder.kt +++ b/plugins/devkit/intellij.devkit.workspaceModel/k2/src/metaModel/WorkspaceMetaModelBuilder.kt @@ -269,7 +269,7 @@ internal class WorkspaceMetaModelBuilder( classSymbol.classKind == KaClassKind.ENUM_CLASS -> { val enumEntries = classSymbol.staticMemberScope.callables.filterIsInstance().map { it.name.asString() } ValueType.Enum(javaClassFqn, superTypesJavaFqns, enumEntries.toList(), - createProperties(classSymbol, knownTypes).asSequence().withoutEnumFields().toList()) + createProperties(classSymbol, knownTypes).withoutEnumFields().toList()) } classSymbol.modality == KaSymbolModality.SEALED && classSymbol is KaNamedClassSymbol -> { val subclasses = classSymbol.sealedClassInheritors diff --git a/plugins/kotlin/refactorings/kotlin.refactorings.common/src/org/jetbrains/kotlin/idea/refactoring/conflicts/kotlinMembersNameConflicts.kt b/plugins/kotlin/refactorings/kotlin.refactorings.common/src/org/jetbrains/kotlin/idea/refactoring/conflicts/kotlinMembersNameConflicts.kt index 91b3c5a25815..7b2522bf5ae2 100644 --- a/plugins/kotlin/refactorings/kotlin.refactorings.common/src/org/jetbrains/kotlin/idea/refactoring/conflicts/kotlinMembersNameConflicts.kt +++ b/plugins/kotlin/refactorings/kotlin.refactorings.common/src/org/jetbrains/kotlin/idea/refactoring/conflicts/kotlinMembersNameConflicts.kt @@ -105,7 +105,7 @@ fun checkDeclarationNewNameConflicts( if (symbol is KaValueParameterSymbol) { val functionLikeSymbol = containingSymbol as KaFunctionSymbol val locals = functionLikeSymbol.psi?.descendantsOfType()?.filter { it.nameAsName == newName } - ?.mapNotNull { it.symbol }?.asSequence() ?: emptySequence() + ?.mapNotNull { it.symbol } ?: emptySequence() return functionLikeSymbol.valueParameters.filter { it.name == newName }.asSequence() + locals } diff --git a/plugins/kotlin/uast/uast-kotlin-fir/src/org/jetbrains/uast/kotlin/internal/FirKotlinUastConstantEvaluator.kt b/plugins/kotlin/uast/uast-kotlin-fir/src/org/jetbrains/uast/kotlin/internal/FirKotlinUastConstantEvaluator.kt index 9aa5400a9296..9c84e2c2f249 100644 --- a/plugins/kotlin/uast/uast-kotlin-fir/src/org/jetbrains/uast/kotlin/internal/FirKotlinUastConstantEvaluator.kt +++ b/plugins/kotlin/uast/uast-kotlin-fir/src/org/jetbrains/uast/kotlin/internal/FirKotlinUastConstantEvaluator.kt @@ -154,7 +154,7 @@ internal object FirKotlinUastConstantEvaluator { if (operands.any { it is String } && operator != UastBinaryOperator.PLUS) { return null } - return operands.asSequence().reduceOrNull { opr1, opr2 -> + return operands.reduceOrNull { opr1, opr2 -> if (opr1 is String || opr2 is String) { return@reduceOrNull opr1.toString() + opr2.toString() } diff --git a/python/src/com/jetbrains/python/sdk/add/v2/models.kt b/python/src/com/jetbrains/python/sdk/add/v2/models.kt index 0346731c8fcb..2270ce839d68 100644 --- a/python/src/com/jetbrains/python/sdk/add/v2/models.kt +++ b/python/src/com/jetbrains/python/sdk/add/v2/models.kt @@ -439,7 +439,7 @@ internal val PythonAddInterpreterModel.existingSdks get() = allInterpreters.value.filterIsInstance().map { it.sdk } internal fun PythonAddInterpreterModel.findInterpreter(path: String): PythonSelectableInterpreter? { - return allInterpreters.value.asSequence().find { it.homePath == path } + return allInterpreters.value.find { it.homePath == path } } internal suspend fun PythonAddInterpreterModel.detectCondaEnvironmentsOrError(errorSink: ErrorSink) { diff --git a/python/src/com/jetbrains/python/sdk/pipenv/PipenvFilesUtils.kt b/python/src/com/jetbrains/python/sdk/pipenv/PipenvFilesUtils.kt index 9185b451f898..a01f928266af 100644 --- a/python/src/com/jetbrains/python/sdk/pipenv/PipenvFilesUtils.kt +++ b/python/src/com/jetbrains/python/sdk/pipenv/PipenvFilesUtils.kt @@ -181,7 +181,7 @@ private suspend fun getPipFileLockRequirements(virtualFile: VirtualFile, package .filterNot { (_, pkg) -> pkg.editable ?: false } // TODO: Support requirements markers (PEP 496), currently any packages with markers are ignored due to PY-30803 .filter { (_, pkg) -> pkg.markers == null } - .flatMap { (name, pkg) -> packageManager.parseRequirements("$name${pkg.version ?: ""}") }.asSequence() + .flatMap { (name, pkg) -> packageManager.parseRequirements("$name${pkg.version ?: ""}") } .toList() val pipFileLock = parsePipFileLock(virtualFile).getOrNull() ?: return null diff --git a/uast/uast-common-ide/src/org/jetbrains/uast/generate/UastCodeGenerationPlugin.kt b/uast/uast-common-ide/src/org/jetbrains/uast/generate/UastCodeGenerationPlugin.kt index 8a4bbcff6b0a..ee44695b51da 100644 --- a/uast/uast-common-ide/src/org/jetbrains/uast/generate/UastCodeGenerationPlugin.kt +++ b/uast/uast-common-ide/src/org/jetbrains/uast/generate/UastCodeGenerationPlugin.kt @@ -21,7 +21,7 @@ interface UastCodeGenerationPlugin { private val extensionPointName = ExtensionPointName("org.jetbrains.uast.generate.uastCodeGenerationPlugin") @JvmStatic - fun byLanguage(language: Language): UastCodeGenerationPlugin? = extensionPointName.extensionList.asSequence().firstOrNull { it.language == language } + fun byLanguage(language: Language): UastCodeGenerationPlugin? = extensionPointName.extensionList.firstOrNull { it.language == language } } /**