diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/configuration/BuildSystemType.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/configuration/BuildSystemType.kt index 4fceda65d9a..b26f1e69a8c 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/configuration/BuildSystemType.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/configuration/BuildSystemType.kt @@ -22,6 +22,7 @@ interface BuildSystemTypeDetector { } fun Module.getBuildSystemType(): BuildSystemType { + @Suppress("DEPRECATION") for (extension in Extensions.getExtensions(BuildSystemTypeDetector.EP_NAME)) { val result = extension.detectBuildSystemType(this) if (result != null) { diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/AfterAnalysisHighlightingVisitor.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/AfterAnalysisHighlightingVisitor.kt index 2522f3d7fda..a49166e7e7f 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/AfterAnalysisHighlightingVisitor.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/AfterAnalysisHighlightingVisitor.kt @@ -31,15 +31,18 @@ abstract class AfterAnalysisHighlightingVisitor protected constructor( holder: AnnotationHolder, protected var bindingContext: BindingContext ) : HighlightingVisitor(holder) { - protected fun attributeKeyForDeclarationFromExtensions(element: PsiElement, descriptor: DeclarationDescriptor) = - Extensions.getExtensions(HighlighterExtension.EP_NAME).firstNotNullResult { extension -> + protected fun attributeKeyForDeclarationFromExtensions(element: PsiElement, descriptor: DeclarationDescriptor): TextAttributesKey? { + @Suppress("DEPRECATION") + return Extensions.getExtensions(HighlighterExtension.EP_NAME).firstNotNullResult { extension -> extension.highlightDeclaration(element, descriptor) } + } protected fun attributeKeyForCallFromExtensions( expression: KtSimpleNameExpression, resolvedCall: ResolvedCall ): TextAttributesKey? { + @Suppress("DEPRECATION") return Extensions.getExtensions(HighlighterExtension.EP_NAME).firstNotNullResult { extension -> extension.highlightCall(expression, resolvedCall) } diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/FunctionsHighlightingVisitor.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/FunctionsHighlightingVisitor.kt index fced0858fe0..ef168d3386f 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/FunctionsHighlightingVisitor.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/FunctionsHighlightingVisitor.kt @@ -77,7 +77,10 @@ internal class FunctionsHighlightingVisitor(holder: AnnotationHolder, bindingCon private fun highlightCall(callee: PsiElement, resolvedCall: ResolvedCall) { val calleeDescriptor = resolvedCall.resultingDescriptor - val key = Extensions.getExtensions(HighlighterExtension.EP_NAME).firstNotNullResult { extension -> + @Suppress("DEPRECATION") + val extensions = Extensions.getExtensions(HighlighterExtension.EP_NAME) + + val key = extensions.firstNotNullResult { extension -> extension.highlightCall(callee, resolvedCall) } ?: when { calleeDescriptor.fqNameOrNull() == KOTLIN_SUSPEND_BUILT_IN_FUNCTION_FQ_NAME -> KEYWORD diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/PropertiesHighlightingVisitor.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/PropertiesHighlightingVisitor.kt index 24140e62ed7..2e01c33e421 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/PropertiesHighlightingVisitor.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/PropertiesHighlightingVisitor.kt @@ -42,6 +42,7 @@ internal class PropertiesHighlightingVisitor(holder: AnnotationHolder, bindingCo val resolvedCall = expression.getResolvedCall(bindingContext) val attributesKey = resolvedCall?.let { call -> + @Suppress("DEPRECATION") Extensions.getExtensions(HighlighterExtension.EP_NAME).firstNotNullResult { extension -> extension.highlightCall(expression, call) } diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/quickfix/QuickFixes.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/quickfix/QuickFixes.kt index 40ca2e360c3..24a3e6b8b34 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/quickfix/QuickFixes.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/quickfix/QuickFixes.kt @@ -29,6 +29,7 @@ class QuickFixes { private val actions: Multimap, IntentionAction> = HashMultimap.create, IntentionAction>() init { + @Suppress("DEPRECATION") Extensions.getExtensions(QuickFixContributor.EP_NAME).forEach { it.registerQuickFixes(this) } } diff --git a/idea/idea-gradle/src/org/jetbrains/kotlin/idea/configuration/KotlinWithGradleConfigurator.kt b/idea/idea-gradle/src/org/jetbrains/kotlin/idea/configuration/KotlinWithGradleConfigurator.kt index 6b03a949cf0..c49e5f2ea5f 100644 --- a/idea/idea-gradle/src/org/jetbrains/kotlin/idea/configuration/KotlinWithGradleConfigurator.kt +++ b/idea/idea-gradle/src/org/jetbrains/kotlin/idea/configuration/KotlinWithGradleConfigurator.kt @@ -75,7 +75,10 @@ abstract class KotlinWithGradleConfigurator : KotlinProjectConfigurator { } private fun PsiFile.isConfiguredByAnyGradleConfigurator(): Boolean { - return Extensions.getExtensions(KotlinProjectConfigurator.EP_NAME) + @Suppress("DEPRECATION") + val extensions = Extensions.getExtensions(KotlinProjectConfigurator.EP_NAME) + + return extensions .filterIsInstance() .any { it.isFileConfigured(this) } } diff --git a/idea/idea-gradle/src/org/jetbrains/kotlin/idea/inspections/gradle/KotlinGradleModelFacade.kt b/idea/idea-gradle/src/org/jetbrains/kotlin/idea/inspections/gradle/KotlinGradleModelFacade.kt index 694c097d724..b7a4b762338 100644 --- a/idea/idea-gradle/src/org/jetbrains/kotlin/idea/inspections/gradle/KotlinGradleModelFacade.kt +++ b/idea/idea-gradle/src/org/jetbrains/kotlin/idea/inspections/gradle/KotlinGradleModelFacade.kt @@ -52,7 +52,10 @@ fun DataNode<*>.getResolvedVersionByModuleData(groupId: String, libraryIds: List } fun getDependencyModules(moduleData: DataNode, gradleIdeaProject: IdeaProject): Collection> { - for (modelFacade in Extensions.getExtensions(KotlinGradleModelFacade.EP_NAME)) { + @Suppress("DEPRECATION") + val extensions = Extensions.getExtensions(KotlinGradleModelFacade.EP_NAME) + + for (modelFacade in extensions) { val dependencies = modelFacade.getDependencyModules(moduleData, gradleIdeaProject) if (dependencies.isNotEmpty()) { return dependencies @@ -61,9 +64,10 @@ fun getDependencyModules(moduleData: DataNode, gradleIdeaProject: Id return emptyList() } +// Removing the 'gradleIdeaProject' parameter, removing it breaks importer for some reason fun findModulesByNames( dependencyModuleNames: Set, - gradleIdeaProject: IdeaProject, + @Suppress("UNUSED_PARAMETER") gradleIdeaProject: IdeaProject, ideProject: DataNode ): LinkedHashSet> { val modules = ExternalSystemApiUtil.getChildren(ideProject, ProjectKeys.MODULE) diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInProjectUtils.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInProjectUtils.kt index 0cbf796db70..50ec107a8bc 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInProjectUtils.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInProjectUtils.kt @@ -180,7 +180,10 @@ fun getConfiguratorByName(name: String): KotlinProjectConfigurator? { return allConfigurators().firstOrNull { it.name == name } } -fun allConfigurators() = Extensions.getExtensions(KotlinProjectConfigurator.EP_NAME) +fun allConfigurators(): Array { + @Suppress("DEPRECATION") + return Extensions.getExtensions(KotlinProjectConfigurator.EP_NAME) +} fun getCanBeConfiguredModules(project: Project, configurator: KotlinProjectConfigurator): List { return ModuleSourceRootMap(project).groupByBaseModules(project.allModules()) @@ -224,6 +227,7 @@ fun getConfigurationPossibilitiesForConfigureNotification( runnableConfigurators.add(configurator) } ConfigureKotlinStatus.CONFIGURED -> moduleAlreadyConfigured = true + else -> {} } } if (moduleCanBeConfigured && !moduleAlreadyConfigured && !SuppressNotificationState.isKotlinNotConfiguredSuppressed( @@ -271,7 +275,7 @@ fun hasKotlinCommonRuntimeInScope(scope: GlobalSearchScope): Boolean { class LibraryKindSearchScope( val module: Module, - val baseScope: GlobalSearchScope, + baseScope: GlobalSearchScope, val libraryKind: PersistentLibraryKind<*> ) : DelegatingGlobalSearchScope(baseScope) { override fun contains(file: VirtualFile): Boolean { diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/KotlinJavaModuleConfigurator.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/KotlinJavaModuleConfigurator.kt index 4714a67f92e..a964674a297 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/KotlinJavaModuleConfigurator.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/KotlinJavaModuleConfigurator.kt @@ -28,7 +28,6 @@ import com.intellij.openapi.roots.OrderRootType import com.intellij.openapi.roots.impl.libraries.LibraryEx import com.intellij.openapi.roots.libraries.Library import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments -import org.jetbrains.kotlin.config.JvmTarget import org.jetbrains.kotlin.idea.compiler.configuration.Kotlin2JvmCompilerArgumentsHolder import org.jetbrains.kotlin.idea.facet.getOrCreateFacet import org.jetbrains.kotlin.idea.facet.initializeIfNeeded @@ -39,7 +38,6 @@ import org.jetbrains.kotlin.idea.util.projectStructure.allModules import org.jetbrains.kotlin.idea.util.projectStructure.sdk import org.jetbrains.kotlin.idea.util.projectStructure.version import org.jetbrains.kotlin.idea.versions.LibraryJarDescriptor -import org.jetbrains.kotlin.platform.impl.JvmIdePlatformKind import org.jetbrains.kotlin.platform.TargetPlatform import org.jetbrains.kotlin.platform.jvm.JvmPlatforms @@ -73,11 +71,11 @@ open class KotlinJavaModuleConfigurator protected constructor() : KotlinWithLibr override val targetPlatform: TargetPlatform get() = JvmPlatforms.unspecifiedJvmPlatform - @Suppress("DEPRECATION_ERROR") + @Suppress("DEPRECATION_ERROR", "OverridingDeprecatedMember") override fun getTargetPlatform() = JvmPlatforms.CompatJvmPlatform override fun getLibraryJarDescriptors(sdk: Sdk?): List { - var result = listOf( + val result = mutableListOf( LibraryJarDescriptor.RUNTIME_JAR, LibraryJarDescriptor.RUNTIME_SRC_JAR, LibraryJarDescriptor.REFLECT_JAR, @@ -142,7 +140,10 @@ open class KotlinJavaModuleConfigurator protected constructor() : KotlinWithLibr const val NAME = "java" val instance: KotlinJavaModuleConfigurator - get() = Extensions.findExtension(KotlinProjectConfigurator.EP_NAME, KotlinJavaModuleConfigurator::class.java) + get() { + @Suppress("DEPRECATION") + return Extensions.findExtension(KotlinProjectConfigurator.EP_NAME, KotlinJavaModuleConfigurator::class.java) + } } private fun hasBrokenJsRuntime(module: Module): Boolean { diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JSLibraryType.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JSLibraryType.kt index 50c06ca1e3c..1a0a5e55cf4 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JSLibraryType.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JSLibraryType.kt @@ -50,6 +50,7 @@ class JSLibraryType : LibraryType(JSLibraryKind) { override fun getIcon(properties: DummyLibraryProperties?) = KotlinIcons.JS companion object { + @Suppress("DEPRECATION") fun getInstance() = Extensions.findExtension(EP_NAME, JSLibraryType::class.java) } diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/KotlinTemplatesFactory.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/KotlinTemplatesFactory.kt index 112b954a950..ec3f616b6d0 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/KotlinTemplatesFactory.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/KotlinTemplatesFactory.kt @@ -56,6 +56,8 @@ class KotlinTemplatesFactory : ProjectTemplatesFactory() { ) ) ) + + @Suppress("DEPRECATION") result.addAll(Extensions.getExtensions(EP_NAME).map { BuilderBasedTemplate(it) }) return result.toTypedArray() } diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/inspections/api/IncompatibleAPIInspection.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/inspections/api/IncompatibleAPIInspection.kt index f56b54e8777..3e840dd5f41 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/inspections/api/IncompatibleAPIInspection.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/inspections/api/IncompatibleAPIInspection.kt @@ -190,7 +190,10 @@ internal fun findProblem( internal fun getQualifiedNameFromProviders(element: PsiElement): String? { DumbService.getInstance(element.project).isAlternativeResolveEnabled = true try { - for (provider in Extensions.getExtensions(QualifiedNameProvider.EP_NAME)) { + @Suppress("DEPRECATION") + val extensions = Extensions.getExtensions(QualifiedNameProvider.EP_NAME) + + for (provider in extensions) { val result = provider.getQualifiedName(element) if (result != null) return result } diff --git a/idea/jvm-debugger/jvm-debugger-core/src/org/jetbrains/kotlin/idea/debugger/InlineCallableUsagesSearcher.kt b/idea/jvm-debugger/jvm-debugger-core/src/org/jetbrains/kotlin/idea/debugger/InlineCallableUsagesSearcher.kt index 5da0b6311fc..5a440510d90 100644 --- a/idea/jvm-debugger/jvm-debugger-core/src/org/jetbrains/kotlin/idea/debugger/InlineCallableUsagesSearcher.kt +++ b/idea/jvm-debugger/jvm-debugger-core/src/org/jetbrains/kotlin/idea/debugger/InlineCallableUsagesSearcher.kt @@ -25,7 +25,7 @@ import com.intellij.psi.PsiElement import com.intellij.psi.PsiReference import com.intellij.psi.search.GlobalSearchScope import com.intellij.psi.search.searches.ReferencesSearch -import com.intellij.xdebugger.impl.XDebugSessionImpl +import com.intellij.xdebugger.impl.XDebuggerManagerImpl import org.jetbrains.kotlin.descriptors.FunctionDescriptor import org.jetbrains.kotlin.descriptors.PropertyDescriptor import org.jetbrains.kotlin.idea.debugger.DebuggerClassNameProvider.Companion.getRelevantElement @@ -75,7 +75,7 @@ class InlineCallableUsagesSearcher(private val myDebugProcess: DebugProcess) { } if (!isSuccess) { - XDebugSessionImpl.NOTIFICATION_GROUP.createNotification( + XDebuggerManagerImpl.NOTIFICATION_GROUP.createNotification( "Debugger can skip some executions of $declarationName because the computation of class names was interrupted", MessageType.WARNING ).notify(myDebugProcess.project) diff --git a/idea/jvm-debugger/jvm-debugger-core/src/org/jetbrains/kotlin/idea/debugger/breakpoints/dialog/AddFieldBreakpointDialog.java b/idea/jvm-debugger/jvm-debugger-core/src/org/jetbrains/kotlin/idea/debugger/breakpoints/dialog/AddFieldBreakpointDialog.java index 1e5b7f40044..8144b6ae93b 100644 --- a/idea/jvm-debugger/jvm-debugger-core/src/org/jetbrains/kotlin/idea/debugger/breakpoints/dialog/AddFieldBreakpointDialog.java +++ b/idea/jvm-debugger/jvm-debugger-core/src/org/jetbrains/kotlin/idea/debugger/breakpoints/dialog/AddFieldBreakpointDialog.java @@ -26,15 +26,12 @@ import com.intellij.openapi.ui.TextFieldWithBrowseButton; import com.intellij.psi.*; import com.intellij.psi.search.GlobalSearchScope; import kotlin.Unit; -import org.jetbrains.annotations.NotNull; import org.jetbrains.kotlin.idea.core.util.DescriptorMemberChooserObject; import org.jetbrains.kotlin.idea.core.util.UiUtilsKt; import org.jetbrains.kotlin.psi.KtProperty; import javax.swing.*; import javax.swing.event.DocumentEvent; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.util.List; public abstract class AddFieldBreakpointDialog extends DialogWrapper { @@ -60,43 +57,41 @@ public abstract class AddFieldBreakpointDialog extends DialogWrapper { } ); - myClassChooser.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - PsiClass currentClass = getSelectedClass(); - TreeClassChooser chooser = TreeClassChooserFactory.getInstance(myProject).createAllProjectScopeChooser( - DebuggerBundle.message("add.field.breakpoint.dialog.classchooser.title")); - if (currentClass != null) { - PsiFile containingFile = currentClass.getContainingFile(); - if (containingFile != null) { - PsiDirectory containingDirectory = containingFile.getContainingDirectory(); - if (containingDirectory != null) { - chooser.selectDirectory(containingDirectory); - } + myClassChooser.addActionListener(e -> { + PsiClass currentClass = getSelectedClass(); + TreeClassChooser chooser = TreeClassChooserFactory.getInstance(myProject).createAllProjectScopeChooser( + DebuggerBundle.message("add.field.breakpoint.dialog.classchooser.title")); + if (currentClass != null) { + PsiFile containingFile = currentClass.getContainingFile(); + if (containingFile != null) { + PsiDirectory containingDirectory = containingFile.getContainingDirectory(); + if (containingDirectory != null) { + chooser.selectDirectory(containingDirectory); } } - chooser.showDialog(); - PsiClass selectedClass = chooser.getSelected(); - if (selectedClass != null) { - myClassChooser.setText(selectedClass.getQualifiedName()); - } + } + chooser.showDialog(); + PsiClass selectedClass = chooser.getSelected(); + if (selectedClass != null) { + myClassChooser.setText(selectedClass.getQualifiedName()); } }); - myFieldChooser.addActionListener(new ActionListener() { - @Override - public void actionPerformed(@NotNull ActionEvent e) { - PsiClass selectedClass = getSelectedClass(); - DescriptorMemberChooserObject[] properties = FieldBreakpointDialogUtilKt.collectProperties(selectedClass); - MemberChooser chooser = new MemberChooser(properties, false, false, myProject); - chooser.setTitle(DebuggerBundle.message("add.field.breakpoint.dialog.field.chooser.title", properties.length)); - chooser.setCopyJavadocVisible(false); - chooser.show(); - List selectedElements = chooser.getSelectedElements(); - if (selectedElements != null && selectedElements.size() == 1) { - KtProperty field = (KtProperty) selectedElements.get(0).getElement(); - myFieldChooser.setText(field.getName()); - } + myFieldChooser.addActionListener(e -> { + PsiClass selectedClass = getSelectedClass(); + if (selectedClass == null) { + return; + } + + DescriptorMemberChooserObject[] properties = FieldBreakpointDialogUtilKt.collectProperties(selectedClass); + MemberChooser chooser = new MemberChooser<>(properties, false, false, myProject); + chooser.setTitle(DebuggerBundle.message("add.field.breakpoint.dialog.field.chooser.title", properties.length)); + chooser.setCopyJavadocVisible(false); + chooser.show(); + List selectedElements = chooser.getSelectedElements(); + if (selectedElements != null && selectedElements.size() == 1) { + KtProperty field = (KtProperty) selectedElements.get(0).getElement(); + myFieldChooser.setText(field.getName()); } }); myFieldChooser.setEnabled(false); @@ -111,7 +106,7 @@ public abstract class AddFieldBreakpointDialog extends DialogWrapper { private PsiClass getSelectedClass() { PsiManager psiManager = PsiManager.getInstance(myProject); String classQName = myClassChooser.getText(); - if (classQName == null || classQName.isEmpty()) { + if (classQName.isEmpty()) { return null; } return JavaPsiFacade.getInstance(psiManager.getProject()).findClass(classQName, GlobalSearchScope.allScope(myProject)); diff --git a/idea/jvm-debugger/jvm-debugger-core/src/org/jetbrains/kotlin/idea/debugger/stepping/DebuggerSteppingHelper.java b/idea/jvm-debugger/jvm-debugger-core/src/org/jetbrains/kotlin/idea/debugger/stepping/DebuggerSteppingHelper.java index 9c646548403..007607d88a9 100644 --- a/idea/jvm-debugger/jvm-debugger-core/src/org/jetbrains/kotlin/idea/debugger/stepping/DebuggerSteppingHelper.java +++ b/idea/jvm-debugger/jvm-debugger-core/src/org/jetbrains/kotlin/idea/debugger/stepping/DebuggerSteppingHelper.java @@ -179,6 +179,7 @@ public class DebuggerSteppingHelper { } } } + //noinspection deprecation for (DebuggerClassFilterProvider provider : Extensions.getExtensions(DebuggerClassFilterProvider.EP_NAME)) { for (ClassFilter filter : provider.getFilters()) { if (filter.isEnabled()) { diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/rename/KotlinRenameDispatcherHandler.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/rename/KotlinRenameDispatcherHandler.kt index c13b27c8959..255f08c5397 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/rename/KotlinRenameDispatcherHandler.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/rename/KotlinRenameDispatcherHandler.kt @@ -31,7 +31,11 @@ class KotlinRenameDispatcherHandler : RenameHandler { companion object { val EP_NAME = ExtensionPointName("org.jetbrains.kotlin.renameHandler") - private val handlers: Array get() = Extensions.getExtensions(EP_NAME) + private val handlers: Array + get() { + @Suppress("DEPRECATION") + return Extensions.getExtensions(EP_NAME) + } } internal fun getRenameHandler(dataContext: DataContext): RenameHandler? { diff --git a/idea/tests/org/jetbrains/kotlin/findUsages/AbstractFindUsagesTest.kt b/idea/tests/org/jetbrains/kotlin/findUsages/AbstractFindUsagesTest.kt index a758cc13536..71ce6b04cf4 100644 --- a/idea/tests/org/jetbrains/kotlin/findUsages/AbstractFindUsagesTest.kt +++ b/idea/tests/org/jetbrains/kotlin/findUsages/AbstractFindUsagesTest.kt @@ -162,7 +162,9 @@ abstract class AbstractFindUsagesTest : KotlinLightCodeInsightFixtureTestCase() return UsageType.COMMENT_USAGE } + @Suppress("DEPRECATION") val providers = Extensions.getExtensions(UsageTypeProvider.EP_NAME) + return providers .mapNotNull { it.getUsageType(element) diff --git a/idea/tests/org/jetbrains/kotlin/idea/inspections/InspectionDescriptionTest.kt b/idea/tests/org/jetbrains/kotlin/idea/inspections/InspectionDescriptionTest.kt index 8597f1f33b7..c3b2c695b61 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/inspections/InspectionDescriptionTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/inspections/InspectionDescriptionTest.kt @@ -67,7 +67,9 @@ class InspectionDescriptionTest : LightPlatformTestCase() { fun testExtensionPoints() { val shortNames = THashMap() + @Suppress("DEPRECATION") val inspectionEPs = Extensions.getExtensions(LocalInspectionEP.LOCAL_INSPECTION) + val tools = inspectionEPs.size val errors = StringBuilder() for (ep in inspectionEPs) { diff --git a/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiFileTest.kt b/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiFileTest.kt index 088f264e3f4..1edb07d9652 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiFileTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixMultiFileTest.kt @@ -66,11 +66,17 @@ abstract class AbstractQuickFixMultiFileTest : KotlinLightCodeInsightFixtureTest private fun enableInspectionTools(klass: Class<*>) { val eps = ContainerUtil.newArrayList() - ContainerUtil.addAll(eps, *Extensions.getExtensions(LocalInspectionEP.LOCAL_INSPECTION)) - ContainerUtil.addAll(eps, *Extensions.getExtensions(InspectionEP.GLOBAL_INSPECTION)) + ContainerUtil.addAll>( + eps, + *(@Suppress("DEPRECATION") Extensions.getExtensions(LocalInspectionEP.LOCAL_INSPECTION)) + ) + ContainerUtil.addAll>( + eps, + *(@Suppress("DEPRECATION") Extensions.getExtensions(InspectionEP.GLOBAL_INSPECTION)) + ) val tool = eps.firstOrNull { it.implementationClass == klass.name }?.instantiateTool() - ?: error("Could not find inspection tool for class: $klass") + ?: error("Could not find inspection tool for class: $klass") myFixture.enableInspections(tool) } diff --git a/idea/tests/org/jetbrains/kotlin/idea/refactoring/inline/AbstractInlineTest.kt b/idea/tests/org/jetbrains/kotlin/idea/refactoring/inline/AbstractInlineTest.kt index 5b1322ab3c1..8d71ef43a0f 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/refactoring/inline/AbstractInlineTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/refactoring/inline/AbstractInlineTest.kt @@ -47,7 +47,10 @@ abstract class AbstractInlineTest : KotlinLightCodeInsightFixtureTestCase() { val afterFileExists = afterFile.exists() val targetElement = TargetElementUtil.findTargetElement(myFixture.editor, ELEMENT_NAME_ACCEPTED or REFERENCED_ELEMENT_ACCEPTED)!! + + @Suppress("DEPRECATION") val handler = Extensions.getExtensions(InlineActionHandler.EP_NAME).firstOrNull { it.canInlineElement(targetElement) } + val expectedErrors = InTextDirectivesUtils.findLinesWithPrefixesRemoved(myFixture.file.text, "// ERROR: ") if (handler != null) { try { diff --git a/idea/tests/org/jetbrains/kotlin/idea/refactoring/rename/AbstractRenameTest.kt b/idea/tests/org/jetbrains/kotlin/idea/refactoring/rename/AbstractRenameTest.kt index 68aeed8dd83..ff1384882d0 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/refactoring/rename/AbstractRenameTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/refactoring/rename/AbstractRenameTest.kt @@ -416,10 +416,11 @@ fun runRenameProcessor( val processor = createProcessor() - if (renameParamsObject["overloadRenamer.onlyPrimaryElement"]?.asBoolean ?: false) { + if (renameParamsObject["overloadRenamer.onlyPrimaryElement"]?.asBoolean == true) { with(AutomaticOverloadsRenamer) { substitution.elementFilter = { false } } } if (processor is RenameProcessor) { + @Suppress("DEPRECATION") Extensions.getExtensions(AutomaticRenamerFactory.EP_NAME).forEach { processor.addRenamerFactory(it) } } processor.run() diff --git a/plugins/kapt3/kapt3-cli/src/KaptCli.kt b/plugins/kapt3/kapt3-cli/src/KaptCli.kt index 48674583f8a..b3e9765c2b2 100644 --- a/plugins/kapt3/kapt3-cli/src/KaptCli.kt +++ b/plugins/kapt3/kapt3-cli/src/KaptCli.kt @@ -31,7 +31,6 @@ fun main(args: Array) { if (messageCollector.hasErrors()) { exitProcess(ExitCode.COMPILATION_ERROR.code) - return } K2JVMCompiler.main(kaptTransformed.toTypedArray())