From 8bd9511e779ceee936149b1c46745e069a3a5c8f Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Sat, 18 Jan 2025 10:01:54 +0100 Subject: [PATCH] cleanup - final and internal GitOrigin-RevId: c08a53abe9527e19dcbced1b00abb75307f9e95a --- .../images/fileTypes/impl/SvgLanguage.kt | 6 +-- .../actions/ShowAffectedTestsAction.java | 24 ++++------ ...MakeMethodOrClassStaticViewDescriptor.java | 5 +- ...ionRefactoringElementListenerProvider.java | 16 +------ platform/lang-impl/api-dump-unreviewed.txt | 4 ++ .../MoveArrangementAliasRuleDownAction.java | 7 +-- .../actions/SurroundWithAction.java | 9 ++-- .../impl/actions/ListTemplatesAction.java | 8 +--- .../codeInsight/unwrap/UnwrapAction.java | 8 ++-- .../cfgView/ShowControlFlowAction.java | 5 +- .../PauseScanningAndIndexingAction.kt | 4 +- .../structuralsearch/api-dump-unreviewed.txt | 9 ++-- .../XmlStructuralSearchProfile.java | 47 +++++++++---------- .../plugin/replace/ui/ReplaceCommand.java | 5 +- .../plugin/ui/filters/TypeFilter.java | 5 +- .../com/intellij/facet/mock/MockFacet.java | 5 +- .../facet/mock/MockFacetConfiguration.java | 5 +- .../intellij/facet/mock/MockSubFacetType.java | 5 +- .../PsiSourcedWebSymbolRefactoringHelper.kt | 5 +- .../PsiSourcedWebSymbolRenameHandler.kt | 5 +- .../com/intellij/webSymbols/WebTestUtil.kt | 5 +- .../inject/config/XPathSupportProxyImpl.java | 7 +-- .../actions/ShowCoveringTestsAction.java | 5 +- .../analysis/JavaCoverageReportEnumerator.kt | 5 +- .../ide/language/xml/XmlProblemFilter.java | 3 +- .../base/analysis/kotlin.base.analysis.iml | 1 + .../KotlinSimilarityFeaturesExtractor.kt | 4 +- .../kotlin.code-insight.impl-base.iml | 1 + .../KotlinBreadcrumbsInfoProvider.kt | 10 ++-- .../kotlin.code-insight.k2.iml | 1 + .../KotlinOverrideHierarchyBrowser.kt | 4 +- plugins/kotlin/coverage/kotlin.coverage.iml | 1 + plugins/kotlin/fir/tests/kotlin.fir.tests.iml | 1 + plugins/kotlin/idea/kotlin.idea.iml | 1 + .../kotlin/idea/tests/kotlin.idea.tests.iml | 2 + .../findUsages/AbstractFindUsagesTest.kt | 9 ++-- .../base/kotlin.searching.base.iml | 1 + .../KotlinDeclarationGroupRuleProvider.kt | 9 ++-- .../kotlin.searching.test.k2.iml | 1 + .../kotlin.performance-tests.iml | 1 + .../kotlin.refactorings.common.iml | 1 + .../kotlin.refactorings.k2.iml | 1 + .../kotlin.refactorings.move.k2.iml | 1 + .../dom/annotator/MavenDomAnnotator.java | 4 +- .../dom/annotator/MavenDomGutterAnnotator.kt | 4 +- .../introduce/IntroducePropertyAction.java | 6 +-- .../rename/ResourceBundleRenamer.java | 5 +- .../ResourceBundleStructureViewComponent.java | 4 +- .../PropertiesDescriptionProvider.java | 5 +- .../PropertyKeysSafeDeleteProcessor.java | 16 +++---- .../typeCook/TypeCookViewDescriptor.java | 4 +- .../SearchEverywhereStateFeaturesProvider.kt | 3 +- .../intellij/sh/rename/ShRenameHandler.java | 2 +- .../xslt/impl/XPathLanguageInjector.java | 2 +- .../xpath/xslt/impl/XsltStuffProvider.java | 2 +- .../impl/XsltBreakpointHandler.java | 10 ++-- .../YAMLAnchorRenameInputValidator.java | 4 +- .../lesson/refactorings/PythonRenameLesson.kt | 4 +- .../spellchecker/quickfixes/RenameTo.java | 2 +- .../xml/refactoring/XmlTagRenameDialog.java | 4 +- .../references/PrefixReferenceProvider.java | 5 +- .../relaxNG/validation/Psi2SaxAdapter.java | 2 +- .../xml/XmlCustomTagHighlightingPass.kt | 7 ++- 63 files changed, 157 insertions(+), 200 deletions(-) diff --git a/images/src/org/intellij/images/fileTypes/impl/SvgLanguage.kt b/images/src/org/intellij/images/fileTypes/impl/SvgLanguage.kt index 5c9eba1af4cc..d4c5a5b91684 100644 --- a/images/src/org/intellij/images/fileTypes/impl/SvgLanguage.kt +++ b/images/src/org/intellij/images/fileTypes/impl/SvgLanguage.kt @@ -1,11 +1,11 @@ -// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.images.fileTypes.impl import com.intellij.lang.xml.XMLLanguage -class SvgLanguage private constructor(): XMLLanguage(XMLLanguage.INSTANCE, "SVG", "image/svg+xml") { +class SvgLanguage private constructor() : XMLLanguage(XMLLanguage.INSTANCE, "SVG", "image/svg+xml") { companion object { @JvmField - val INSTANCE = SvgLanguage() + val INSTANCE: SvgLanguage = SvgLanguage() } } \ No newline at end of file diff --git a/java/execution/impl/src/com/intellij/execution/testDiscovery/actions/ShowAffectedTestsAction.java b/java/execution/impl/src/com/intellij/execution/testDiscovery/actions/ShowAffectedTestsAction.java index d3e0dd6c2947..f649683f6143 100644 --- a/java/execution/impl/src/com/intellij/execution/testDiscovery/actions/ShowAffectedTestsAction.java +++ b/java/execution/impl/src/com/intellij/execution/testDiscovery/actions/ShowAffectedTestsAction.java @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.execution.testDiscovery.actions; import com.intellij.CommonBundle; @@ -34,10 +34,7 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.ProjectFileIndex; import com.intellij.openapi.ui.popup.JBPopup; import com.intellij.openapi.ui.popup.PopupChooserBuilder; -import com.intellij.openapi.util.Couple; -import com.intellij.openapi.util.Disposer; -import com.intellij.openapi.util.NlsActions; -import com.intellij.openapi.util.Ref; +import com.intellij.openapi.util.*; import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.vcs.VcsDataKeys; import com.intellij.openapi.vcs.changes.Change; @@ -80,9 +77,6 @@ import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; -import static com.intellij.openapi.actionSystem.CommonDataKeys.*; -import static com.intellij.openapi.util.Pair.pair; - public final class ShowAffectedTestsAction extends AnAction { @Override public @NotNull ActionUpdateThread getActionUpdateThread() { @@ -157,7 +151,7 @@ public final class ShowAffectedTestsAction extends AnAction { private static void showDiscoveredTestsByPsiClass(@NotNull Project project, @NotNull PsiClass psiClass, @NotNull AnActionEvent e) { if (DumbService.isDumb(project)) return; - DataContext dataContext = DataManager.getInstance().getDataContext(e.getRequiredData(EDITOR).getContentComponent()); + DataContext dataContext = DataManager.getInstance().getDataContext(e.getRequiredData(CommonDataKeys.EDITOR).getContentComponent()); FeatureUsageTracker.getInstance().triggerFeatureUsed("test.discovery"); String presentableName = PsiFormatUtil.formatClass(psiClass, PsiFormatUtilBase.SHOW_NAME); DiscoveredTestsTree tree = showTree(project, dataContext, presentableName, e.getPlace()); @@ -174,7 +168,7 @@ public final class ShowAffectedTestsAction extends AnAction { private static void showDiscoveredTestsByPsiMethod(@NotNull Project project, @NotNull PsiMethod method, @NotNull AnActionEvent e) { Couple key = getMethodKey(method); if (key == null) return; - DataContext dataContext = DataManager.getInstance().getDataContext(e.getRequiredData(EDITOR).getContentComponent()); + DataContext dataContext = DataManager.getInstance().getDataContext(e.getRequiredData(CommonDataKeys.EDITOR).getContentComponent()); FeatureUsageTracker.getInstance().triggerFeatureUsed("test.discovery"); String presentableName = PsiFormatUtil.formatMethod(method, PsiSubstitutor.EMPTY, PsiFormatUtilBase.SHOW_CONTAINING_CLASS | PsiFormatUtilBase.SHOW_NAME, 0); DiscoveredTestsTree tree = showTree(project, dataContext, presentableName, e.getPlace()); @@ -270,9 +264,9 @@ public final class ShowAffectedTestsAction extends AnAction { } private static @NotNull List findFilesInContext(@NotNull AnActionEvent event) { - VirtualFile[] virtualFiles = event.getData(VIRTUAL_FILE_ARRAY); + VirtualFile[] virtualFiles = event.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY); if (virtualFiles == null || virtualFiles.length == 0) { - PsiFile file = event.getData(PSI_FILE); + PsiFile file = event.getData(CommonDataKeys.PSI_FILE); if (file != null) { virtualFiles = new VirtualFile[]{file.getVirtualFile()}; } @@ -293,8 +287,8 @@ public final class ShowAffectedTestsAction extends AnAction { } private static @Nullable PsiElement findElementAtCaret(@NotNull AnActionEvent e) { - Editor editor = e.getData(EDITOR); - PsiFile file = e.getData(PSI_FILE); + Editor editor = e.getData(CommonDataKeys.EDITOR); + PsiFile file = e.getData(CommonDataKeys.PSI_FILE); if (editor == null || file == null) return null; int offset = editor.getCaretModel().getOffset(); PsiElement at = file.findElementAt(offset); @@ -474,7 +468,7 @@ public final class ShowAffectedTestsAction extends AnAction { .toList(); getRunConfigurationProducers(project).stream() - .map(producer -> pair(producer, ContainerUtil.filter(testMethods, producer::isApplicable))) + .map(producer -> Pair.pair(producer, ContainerUtil.filter(testMethods, producer::isApplicable))) .max(Comparator.comparingInt(p -> p.second.size())) .map(p -> { @SuppressWarnings("unchecked") Location[] locations = p.second.toArray(new Location[0]); diff --git a/java/java-impl-refactorings/src/com/intellij/refactoring/makeStatic/MakeMethodOrClassStaticViewDescriptor.java b/java/java-impl-refactorings/src/com/intellij/refactoring/makeStatic/MakeMethodOrClassStaticViewDescriptor.java index 5a12258856b5..10aeb0cac016 100644 --- a/java/java-impl-refactorings/src/com/intellij/refactoring/makeStatic/MakeMethodOrClassStaticViewDescriptor.java +++ b/java/java-impl-refactorings/src/com/intellij/refactoring/makeStatic/MakeMethodOrClassStaticViewDescriptor.java @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.refactoring.makeStatic; @@ -13,8 +13,7 @@ import com.intellij.usageView.UsageViewDescriptor; import com.intellij.usageView.UsageViewUtil; import org.jetbrains.annotations.NotNull; -public class MakeMethodOrClassStaticViewDescriptor implements UsageViewDescriptor { - +public final class MakeMethodOrClassStaticViewDescriptor implements UsageViewDescriptor { private final PsiMember myMember; private final @NlsContexts.ListItem String myProcessedElementsHeader; diff --git a/platform/execution-impl/src/com/intellij/execution/impl/RunConfigurationRefactoringElementListenerProvider.java b/platform/execution-impl/src/com/intellij/execution/impl/RunConfigurationRefactoringElementListenerProvider.java index f12a59ffe32b..3cf5a17f0d9b 100644 --- a/platform/execution-impl/src/com/intellij/execution/impl/RunConfigurationRefactoringElementListenerProvider.java +++ b/platform/execution-impl/src/com/intellij/execution/impl/RunConfigurationRefactoringElementListenerProvider.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.execution.impl; import com.intellij.execution.RunManager; diff --git a/platform/lang-impl/api-dump-unreviewed.txt b/platform/lang-impl/api-dump-unreviewed.txt index 1719fe301450..1f46a68dbf37 100644 --- a/platform/lang-impl/api-dump-unreviewed.txt +++ b/platform/lang-impl/api-dump-unreviewed.txt @@ -5455,6 +5455,10 @@ f:com.intellij.codeInsight.template.impl.WrapWithCustomTemplateAction - (com.intellij.codeInsight.template.CustomLiveTemplate,com.intellij.openapi.editor.Editor,com.intellij.psi.PsiFile,java.util.Set,java.lang.Runnable):V - actionPerformed(com.intellij.openapi.actionSystem.AnActionEvent):V - perform():V +f:com.intellij.codeInsight.template.impl.actions.ListTemplatesAction +- com.intellij.codeInsight.actions.BaseCodeInsightAction +- com.intellij.openapi.project.DumbAware +- ():V c:com.intellij.codeInsight.template.impl.actions.SurroundWithTemplateAction - com.intellij.codeInsight.actions.BaseCodeInsightAction - ():V diff --git a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/action/tokens/MoveArrangementAliasRuleDownAction.java b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/action/tokens/MoveArrangementAliasRuleDownAction.java index 601759d6ee39..223025fd467e 100644 --- a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/action/tokens/MoveArrangementAliasRuleDownAction.java +++ b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/action/tokens/MoveArrangementAliasRuleDownAction.java @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.application.options.codeStyle.arrangement.action.tokens; import com.intellij.application.options.codeStyle.arrangement.action.MoveArrangementMatchingRuleDownAction; @@ -8,10 +8,7 @@ import com.intellij.openapi.actionSystem.AnActionEvent; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -/** - * @author Svetlana.Zemlyanskaya - */ -public final class MoveArrangementAliasRuleDownAction extends MoveArrangementMatchingRuleDownAction { +final class MoveArrangementAliasRuleDownAction extends MoveArrangementMatchingRuleDownAction { @Override protected @Nullable ArrangementMatchingRulesControl getRulesControl(@NotNull AnActionEvent e) { return e.getData(ArrangementRuleAliasControl.KEY); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/generation/actions/SurroundWithAction.java b/platform/lang-impl/src/com/intellij/codeInsight/generation/actions/SurroundWithAction.java index 06dba4555486..21d3cb3cb602 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/generation/actions/SurroundWithAction.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/generation/actions/SurroundWithAction.java @@ -1,5 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInsight.generation.actions; import com.intellij.codeInsight.CodeInsightActionHandler; @@ -14,12 +13,10 @@ import com.intellij.openapi.project.Project; import com.intellij.psi.PsiBinaryFile; import com.intellij.psi.PsiFile; import com.intellij.psi.util.PsiUtilCore; -import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; -@ApiStatus.Internal -public final class SurroundWithAction extends BaseCodeInsightAction { - public SurroundWithAction() { +final class SurroundWithAction extends BaseCodeInsightAction { + SurroundWithAction() { setEnabledInModalContext(true); } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/actions/ListTemplatesAction.java b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/actions/ListTemplatesAction.java index 586ec1263342..414ac4fad5c2 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/actions/ListTemplatesAction.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/actions/ListTemplatesAction.java @@ -1,17 +1,13 @@ - -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInsight.template.impl.actions; import com.intellij.codeInsight.CodeInsightActionHandler; import com.intellij.codeInsight.actions.BaseCodeInsightAction; import com.intellij.codeInsight.template.impl.ListTemplatesHandler; import com.intellij.openapi.project.DumbAware; -import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; -@ApiStatus.Internal -public class ListTemplatesAction extends BaseCodeInsightAction implements DumbAware { +public final class ListTemplatesAction extends BaseCodeInsightAction implements DumbAware { @Override protected @NotNull CodeInsightActionHandler getHandler() { return new ListTemplatesHandler(); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/unwrap/UnwrapAction.java b/platform/lang-impl/src/com/intellij/codeInsight/unwrap/UnwrapAction.java index c1bcfa250745..a107b1d8bc10 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/unwrap/UnwrapAction.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/unwrap/UnwrapAction.java @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInsight.unwrap; @@ -7,12 +7,10 @@ import com.intellij.codeInsight.actions.BaseCodeInsightAction; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiFile; -import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; -@ApiStatus.Internal -public final class UnwrapAction extends BaseCodeInsightAction{ - public UnwrapAction() { +final class UnwrapAction extends BaseCodeInsightAction{ + UnwrapAction() { super(true); setEnabledInModalContext(true); } diff --git a/platform/lang-impl/src/com/intellij/internal/cfgView/ShowControlFlowAction.java b/platform/lang-impl/src/com/intellij/internal/cfgView/ShowControlFlowAction.java index 526fdde4e3fe..136aad275a86 100644 --- a/platform/lang-impl/src/com/intellij/internal/cfgView/ShowControlFlowAction.java +++ b/platform/lang-impl/src/com/intellij/internal/cfgView/ShowControlFlowAction.java @@ -1,12 +1,11 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.internal.cfgView; import com.intellij.codeInsight.CodeInsightActionHandler; import com.intellij.codeInsight.actions.BaseCodeInsightAction; import org.jetbrains.annotations.NotNull; -public final class ShowControlFlowAction extends BaseCodeInsightAction { - +final class ShowControlFlowAction extends BaseCodeInsightAction { @Override protected @NotNull CodeInsightActionHandler getHandler() { return new ShowControlFlowHandler(); diff --git a/platform/lang-impl/src/com/intellij/util/indexing/internal/PauseScanningAndIndexingAction.kt b/platform/lang-impl/src/com/intellij/util/indexing/internal/PauseScanningAndIndexingAction.kt index ccdbcb6157be..25ef5eb207c2 100644 --- a/platform/lang-impl/src/com/intellij/util/indexing/internal/PauseScanningAndIndexingAction.kt +++ b/platform/lang-impl/src/com/intellij/util/indexing/internal/PauseScanningAndIndexingAction.kt @@ -1,11 +1,11 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.util.indexing.internal import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.components.service -class PauseScanningAndIndexingAction : AnAction() { +private class PauseScanningAndIndexingAction : AnAction() { override fun actionPerformed(e: AnActionEvent) { e.project?.service()?.pauseScanningAndIndexingAndRunEmptyTask() } diff --git a/platform/structuralsearch/api-dump-unreviewed.txt b/platform/structuralsearch/api-dump-unreviewed.txt index c9f24b83ec38..0b3e7a6d9841 100644 --- a/platform/structuralsearch/api-dump-unreviewed.txt +++ b/platform/structuralsearch/api-dump-unreviewed.txt @@ -331,7 +331,7 @@ f:com.intellij.structuralsearch.StructuralSearchUtil c:com.intellij.structuralsearch.UnsupportedPatternException - com.intellij.structuralsearch.StructuralSearchException - (java.lang.String):V -c:com.intellij.structuralsearch.XmlStructuralSearchProfile +f:com.intellij.structuralsearch.XmlStructuralSearchProfile - com.intellij.structuralsearch.StructuralSearchProfile - ():V - checkReplacementPattern(com.intellij.openapi.project.Project,com.intellij.structuralsearch.plugin.replace.ReplaceOptions):V @@ -876,11 +876,9 @@ c:com.intellij.structuralsearch.plugin.replace.impl.Replacer - s:testReplace(java.lang.String,java.lang.String,java.lang.String,com.intellij.structuralsearch.plugin.replace.ReplaceOptions,com.intellij.openapi.project.Project,Z,Z,com.intellij.openapi.fileTypes.LanguageFileType,com.intellij.lang.Language):java.lang.String f:com.intellij.structuralsearch.plugin.replace.impl.ReplacerUtil - s:copySpacesAndCommentsBefore(com.intellij.psi.PsiElement,com.intellij.psi.PsiElement[],java.lang.String,com.intellij.psi.PsiElement):com.intellij.psi.PsiElement -c:com.intellij.structuralsearch.plugin.replace.ui.ReplaceCommand +f:com.intellij.structuralsearch.plugin.replace.ui.ReplaceCommand - com.intellij.structuralsearch.plugin.ui.SearchCommand - (com.intellij.structuralsearch.plugin.ui.Configuration,com.intellij.structuralsearch.plugin.ui.SearchContext):V -- p:createUsageViewContext():com.intellij.structuralsearch.plugin.ui.UsageViewContext -- p:foundUsage(com.intellij.structuralsearch.MatchResult,com.intellij.usages.Usage):V c:com.intellij.structuralsearch.plugin.replace.ui.ReplaceConfiguration - com.intellij.structuralsearch.plugin.ui.Configuration - sf:REPLACEMENT_VARIABLE_SUFFIX:java.lang.String @@ -1217,7 +1215,7 @@ c:com.intellij.structuralsearch.plugin.ui.filters.TextFilter - hasFilter():Z - isApplicable(java.util.List,Z,Z):Z - p:setLabel(com.intellij.ui.SimpleColoredComponent):V -c:com.intellij.structuralsearch.plugin.ui.filters.TypeFilter +f:com.intellij.structuralsearch.plugin.ui.filters.TypeFilter - com.intellij.structuralsearch.plugin.ui.filters.FilterAction - ():V - clearFilter():V @@ -1225,7 +1223,6 @@ c:com.intellij.structuralsearch.plugin.ui.filters.TypeFilter - getShortText(com.intellij.structuralsearch.NamedScriptableDefinition):java.lang.String - hasFilter():Z - isApplicable(java.util.List,Z,Z):Z -- p:setLabel(com.intellij.ui.SimpleColoredComponent):V c:com.intellij.structuralsearch.plugin.util.CollectingMatchResultSink - com.intellij.structuralsearch.DefaultMatchResultSink - ():V diff --git a/platform/structuralsearch/source/com/intellij/structuralsearch/XmlStructuralSearchProfile.java b/platform/structuralsearch/source/com/intellij/structuralsearch/XmlStructuralSearchProfile.java index df4168110393..86134174d615 100644 --- a/platform/structuralsearch/source/com/intellij/structuralsearch/XmlStructuralSearchProfile.java +++ b/platform/structuralsearch/source/com/intellij/structuralsearch/XmlStructuralSearchProfile.java @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.structuralsearch; import com.intellij.codeInsight.template.TemplateContextType; @@ -30,10 +30,7 @@ import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import static com.intellij.structuralsearch.PredefinedConfigurationUtil.createConfiguration; -import static com.intellij.structuralsearch.PredefinedConfigurationUtil.createLegacyConfiguration; - -public class XmlStructuralSearchProfile extends StructuralSearchProfile { +public final class XmlStructuralSearchProfile extends StructuralSearchProfile { @Override public void compile(PsiElement @NotNull [] elements, @NotNull GlobalCompilingVisitor globalVisitor) { @@ -240,26 +237,26 @@ public class XmlStructuralSearchProfile extends StructuralSearchProfile { private static final class XmlPredefinedConfigurations { static Configuration[] createPredefinedTemplates() { return new Configuration[]{ - createLegacyConfiguration(SSRBundle.message("predefined.template.xml.tag"), "Xml tag", - "<'a/>", getHtmlXml(), XmlFileType.INSTANCE), - createLegacyConfiguration(SSRBundle.message("predefined.template.xml.attribute"), "Xml attribute", - "<'_tag 'attribute=\"'_value\"/>", getHtmlXml(), XmlFileType.INSTANCE), - createLegacyConfiguration(SSRBundle.message("predefined.template.html.attribute"), "Html attribute", - "<'_tag 'attribute />", getHtmlXml(), HtmlFileType.INSTANCE), - createLegacyConfiguration(SSRBundle.message("predefined.template.xml.attribute.value"), "Xml attribute value", - "<'_tag '_attribute=\"'value\"/>", getHtmlXml(), XmlFileType.INSTANCE), - createLegacyConfiguration(SSRBundle.message("predefined.template.html.attribute.value"), "Html attribute value", - "<'_tag '_attribute='value />", getHtmlXml(), HtmlFileType.INSTANCE), - createLegacyConfiguration(SSRBundle.message("predefined.template.xml.html.tag.value"), "Xml/html tag value", - "'_content*
", getHtmlXml(), HtmlFileType.INSTANCE), - createLegacyConfiguration(SSRBundle.message("predefined.template.ul.or.ol"), "
    or
      ", - "<'_tag:[regex( ul|ol )] />", getHtmlXml(), HtmlFileType.INSTANCE), - createLegacyConfiguration(SSRBundle.message("predefined.template.li.not.contained.in.ul.or.ol"), "
    1. not contained in
        or
          ", - "[!within(
            or
              )]
            1. ", getHtmlXml(), HtmlFileType.INSTANCE), - createLegacyConfiguration(SSRBundle.message("predefined.configuration.xml.attribute.referencing.java.class"), "xml attribute referencing java class", - "<'_tag 'attribute=\"'_value:[ref( classes, interfaces \\& enums )]\"/>", getHtmlXml(), XmlFileType.INSTANCE), - createConfiguration(SSRBundle.message("predefined.template.xml.tag.without.specific.attribute"), "XML tag without a specific attribute", - "<'_tag '_attr{0,0}:attributeName />", getHtmlXml(), XmlFileType.INSTANCE), + PredefinedConfigurationUtil.createLegacyConfiguration(SSRBundle.message("predefined.template.xml.tag"), "Xml tag", + "<'a/>", getHtmlXml(), XmlFileType.INSTANCE), + PredefinedConfigurationUtil.createLegacyConfiguration(SSRBundle.message("predefined.template.xml.attribute"), "Xml attribute", + "<'_tag 'attribute=\"'_value\"/>", getHtmlXml(), XmlFileType.INSTANCE), + PredefinedConfigurationUtil.createLegacyConfiguration(SSRBundle.message("predefined.template.html.attribute"), "Html attribute", + "<'_tag 'attribute />", getHtmlXml(), HtmlFileType.INSTANCE), + PredefinedConfigurationUtil.createLegacyConfiguration(SSRBundle.message("predefined.template.xml.attribute.value"), "Xml attribute value", + "<'_tag '_attribute=\"'value\"/>", getHtmlXml(), XmlFileType.INSTANCE), + PredefinedConfigurationUtil.createLegacyConfiguration(SSRBundle.message("predefined.template.html.attribute.value"), "Html attribute value", + "<'_tag '_attribute='value />", getHtmlXml(), HtmlFileType.INSTANCE), + PredefinedConfigurationUtil.createLegacyConfiguration(SSRBundle.message("predefined.template.xml.html.tag.value"), "Xml/html tag value", + "'_content*
              ", getHtmlXml(), HtmlFileType.INSTANCE), + PredefinedConfigurationUtil.createLegacyConfiguration(SSRBundle.message("predefined.template.ul.or.ol"), "
                or
                  ", + "<'_tag:[regex( ul|ol )] />", getHtmlXml(), HtmlFileType.INSTANCE), + PredefinedConfigurationUtil.createLegacyConfiguration(SSRBundle.message("predefined.template.li.not.contained.in.ul.or.ol"), "
                1. not contained in
                    or
                      ", + "[!within(
                        or
                          )]
                        1. ", getHtmlXml(), HtmlFileType.INSTANCE), + PredefinedConfigurationUtil.createLegacyConfiguration(SSRBundle.message("predefined.configuration.xml.attribute.referencing.java.class"), "xml attribute referencing java class", + "<'_tag 'attribute=\"'_value:[ref( classes, interfaces \\& enums )]\"/>", getHtmlXml(), XmlFileType.INSTANCE), + PredefinedConfigurationUtil.createConfiguration(SSRBundle.message("predefined.template.xml.tag.without.specific.attribute"), "XML tag without a specific attribute", + "<'_tag '_attr{0,0}:attributeName />", getHtmlXml(), XmlFileType.INSTANCE), }; } diff --git a/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceCommand.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceCommand.java index 7efaaa805a4a..73cb0f80a311 100644 --- a/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceCommand.java +++ b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/ui/ReplaceCommand.java @@ -1,4 +1,4 @@ -// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.structuralsearch.plugin.replace.ui; import com.intellij.structuralsearch.MatchResult; @@ -9,8 +9,7 @@ import com.intellij.structuralsearch.plugin.ui.UsageViewContext; import com.intellij.usages.Usage; import org.jetbrains.annotations.NotNull; -public class ReplaceCommand extends SearchCommand { - +public final class ReplaceCommand extends SearchCommand { private ReplaceUsageViewContext myReplaceUsageViewContext; public ReplaceCommand(@NotNull Configuration configuration, @NotNull SearchContext searchContext) { diff --git a/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/filters/TypeFilter.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/filters/TypeFilter.java index 9e08528ad446..4c89b95a2420 100644 --- a/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/filters/TypeFilter.java +++ b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/filters/TypeFilter.java @@ -1,4 +1,4 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.structuralsearch.plugin.ui.filters; import com.intellij.openapi.editor.Document; @@ -23,8 +23,7 @@ import java.util.List; /** * @author Bas Leijdekkers */ -public class TypeFilter extends FilterAction { - +public final class TypeFilter extends FilterAction { boolean myShowRegex; public TypeFilter() { diff --git a/platform/testFramework/src/com/intellij/facet/mock/MockFacet.java b/platform/testFramework/src/com/intellij/facet/mock/MockFacet.java index efd6211647c6..8ae703a9ac9e 100644 --- a/platform/testFramework/src/com/intellij/facet/mock/MockFacet.java +++ b/platform/testFramework/src/com/intellij/facet/mock/MockFacet.java @@ -1,5 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.facet.mock; import com.intellij.facet.Facet; @@ -14,7 +13,7 @@ import org.jetbrains.annotations.Unmodifiable; import java.util.Collection; -public class MockFacet extends Facet implements FacetRootsProvider { +public final class MockFacet extends Facet implements FacetRootsProvider { private boolean myInitialized; private boolean myDisposed; private boolean myConfigured; diff --git a/platform/testFramework/src/com/intellij/facet/mock/MockFacetConfiguration.java b/platform/testFramework/src/com/intellij/facet/mock/MockFacetConfiguration.java index 81f7b38a1bac..55dc415d4d53 100644 --- a/platform/testFramework/src/com/intellij/facet/mock/MockFacetConfiguration.java +++ b/platform/testFramework/src/com/intellij/facet/mock/MockFacetConfiguration.java @@ -1,5 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. - +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.facet.mock; import com.intellij.facet.FacetConfiguration; @@ -16,7 +15,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -public class MockFacetConfiguration implements FacetConfiguration { +public final class MockFacetConfiguration implements FacetConfiguration { private final List myRootUrls = new ArrayList<>(); private String myData = ""; private MockFacetEditorTab myEditor; diff --git a/platform/testFramework/src/com/intellij/facet/mock/MockSubFacetType.java b/platform/testFramework/src/com/intellij/facet/mock/MockSubFacetType.java index ad02af8d30db..77010e6a12de 100644 --- a/platform/testFramework/src/com/intellij/facet/mock/MockSubFacetType.java +++ b/platform/testFramework/src/com/intellij/facet/mock/MockSubFacetType.java @@ -1,5 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. - +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.facet.mock; import com.intellij.facet.Facet; @@ -10,7 +9,7 @@ import com.intellij.openapi.module.ModuleType; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -public class MockSubFacetType extends FacetType { +public final class MockSubFacetType extends FacetType { public static final FacetTypeId ID = new FacetTypeId<>("submock"); public MockSubFacetType() { diff --git a/platform/webSymbols/src/com/intellij/webSymbols/refactoring/PsiSourcedWebSymbolRefactoringHelper.kt b/platform/webSymbols/src/com/intellij/webSymbols/refactoring/PsiSourcedWebSymbolRefactoringHelper.kt index 4a64b1a3df46..2446b2b04b69 100644 --- a/platform/webSymbols/src/com/intellij/webSymbols/refactoring/PsiSourcedWebSymbolRefactoringHelper.kt +++ b/platform/webSymbols/src/com/intellij/webSymbols/refactoring/PsiSourcedWebSymbolRefactoringHelper.kt @@ -1,3 +1,4 @@ +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.webSymbols.refactoring import com.intellij.openapi.application.WriteAction @@ -9,10 +10,8 @@ import com.intellij.refactoring.rename.RenameUtil import com.intellij.usageView.UsageInfo import com.intellij.webSymbols.search.PsiSourcedWebSymbolReference import com.intellij.webSymbols.search.PsiSourcedWebSymbolReference.RenameHandler -import org.jetbrains.annotations.ApiStatus -@ApiStatus.Internal -class PsiSourcedWebSymbolRefactoringHelper : RefactoringHelper> { +private class PsiSourcedWebSymbolRefactoringHelper : RefactoringHelper> { override fun prepareOperation(usages: Array, elements: List): List = usages.mapNotNull { (it.reference as? PsiSourcedWebSymbolReference)?.createRenameHandler() } diff --git a/platform/webSymbols/src/com/intellij/webSymbols/refactoring/PsiSourcedWebSymbolRenameHandler.kt b/platform/webSymbols/src/com/intellij/webSymbols/refactoring/PsiSourcedWebSymbolRenameHandler.kt index 6dafc28abff4..fc5d1fdedee3 100644 --- a/platform/webSymbols/src/com/intellij/webSymbols/refactoring/PsiSourcedWebSymbolRenameHandler.kt +++ b/platform/webSymbols/src/com/intellij/webSymbols/refactoring/PsiSourcedWebSymbolRenameHandler.kt @@ -1,3 +1,4 @@ +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.webSymbols.refactoring import com.intellij.openapi.actionSystem.CommonDataKeys @@ -11,10 +12,8 @@ import com.intellij.psi.SyntheticElement import com.intellij.refactoring.rename.PsiElementRenameHandler import com.intellij.refactoring.rename.RenameHandler import com.intellij.webSymbols.PsiSourcedWebSymbol -import org.jetbrains.annotations.ApiStatus -@ApiStatus.Internal -class PsiSourcedWebSymbolRenameHandler : RenameHandler { +private class PsiSourcedWebSymbolRenameHandler : RenameHandler { override fun invoke(project: Project, editor: Editor?, file: PsiFile?, dataContext: DataContext?) { if (editor == null || file == null || dataContext == null) return diff --git a/platform/webSymbols/testSrc/com/intellij/webSymbols/WebTestUtil.kt b/platform/webSymbols/testSrc/com/intellij/webSymbols/WebTestUtil.kt index 0fbb4a39e0e2..c00f6aedd804 100644 --- a/platform/webSymbols/testSrc/com/intellij/webSymbols/WebTestUtil.kt +++ b/platform/webSymbols/testSrc/com/intellij/webSymbols/WebTestUtil.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. @file:JvmName("WebTestUtil") package com.intellij.webSymbols @@ -61,7 +61,8 @@ import java.util.concurrent.Callable import kotlin.math.max import kotlin.math.min -internal val webSymbolsTestsDataPath get() = "${PlatformTestUtil.getCommunityPath()}/platform/webSymbols/testData/" +internal val webSymbolsTestsDataPath: String + get() = "${PlatformTestUtil.getCommunityPath()}/platform/webSymbols/testData/" fun UsefulTestCase.enableAstLoadingFilter() { Registry.get("ast.loading.filter").setValue(true, testRootDisposable) diff --git a/plugins/IntelliLang/xml-support/org/intellij/plugins/intelliLang/inject/config/XPathSupportProxyImpl.java b/plugins/IntelliLang/xml-support/org/intellij/plugins/intelliLang/inject/config/XPathSupportProxyImpl.java index caf7f16614dd..12730a5d7a19 100644 --- a/plugins/IntelliLang/xml-support/org/intellij/plugins/intelliLang/inject/config/XPathSupportProxyImpl.java +++ b/plugins/IntelliLang/xml-support/org/intellij/plugins/intelliLang/inject/config/XPathSupportProxyImpl.java @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.plugins.intelliLang.inject.config; import com.intellij.psi.PsiFile; @@ -20,10 +20,7 @@ import javax.xml.namespace.QName; import java.util.Collections; import java.util.Set; -/** -* @author Gregory.Shrago -*/ -public class XPathSupportProxyImpl extends XPathSupportProxy { +final class XPathSupportProxyImpl extends XPathSupportProxy { private static class Provider extends ContextProvider { private final XmlTokenImpl myDummyContext = new XmlTokenImpl(XmlTokenType.XML_CONTENT_EMPTY, "") { @Override diff --git a/plugins/coverage-common/src/com/intellij/coverage/actions/ShowCoveringTestsAction.java b/plugins/coverage-common/src/com/intellij/coverage/actions/ShowCoveringTestsAction.java index 746a06fc9838..d6ba214a581a 100644 --- a/plugins/coverage-common/src/com/intellij/coverage/actions/ShowCoveringTestsAction.java +++ b/plugins/coverage-common/src/com/intellij/coverage/actions/ShowCoveringTestsAction.java @@ -1,5 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.coverage.actions; import com.intellij.codeInsight.hint.HintManager; @@ -38,7 +37,7 @@ import java.util.Set; import java.util.function.Consumer; @ApiStatus.Internal -public class ShowCoveringTestsAction extends AnAction { +public final class ShowCoveringTestsAction extends AnAction { private static final Logger LOG = Logger.getInstance(ShowCoveringTestsAction.class); private final CoverageSuitesBundle myBundle; diff --git a/plugins/coverage/src/com/intellij/coverage/analysis/JavaCoverageReportEnumerator.kt b/plugins/coverage/src/com/intellij/coverage/analysis/JavaCoverageReportEnumerator.kt index a5b961768699..902d1e502652 100644 --- a/plugins/coverage/src/com/intellij/coverage/analysis/JavaCoverageReportEnumerator.kt +++ b/plugins/coverage/src/com/intellij/coverage/analysis/JavaCoverageReportEnumerator.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.coverage.analysis import com.intellij.coverage.CoverageSuitesBundle @@ -9,8 +9,7 @@ import com.intellij.openapi.roots.ModuleRootManager import com.intellij.openapi.util.text.StringUtil import com.intellij.openapi.vfs.VirtualFile - -object JavaCoverageReportEnumerator { +internal object JavaCoverageReportEnumerator { @JvmStatic fun collectSummaryInReport(bundle: CoverageSuitesBundle, project: Project, collector: CoverageInfoCollector) { val projectData = bundle.coverageData ?: return diff --git a/plugins/grazie/xml/main/kotlin/com/intellij/grazie/ide/language/xml/XmlProblemFilter.java b/plugins/grazie/xml/main/kotlin/com/intellij/grazie/ide/language/xml/XmlProblemFilter.java index a9eb8ebbc734..d98d5d9307f2 100644 --- a/plugins/grazie/xml/main/kotlin/com/intellij/grazie/ide/language/xml/XmlProblemFilter.java +++ b/plugins/grazie/xml/main/kotlin/com/intellij/grazie/ide/language/xml/XmlProblemFilter.java @@ -6,7 +6,8 @@ import com.intellij.grazie.text.TextProblem; import com.intellij.openapi.util.text.Strings; import org.jetbrains.annotations.NotNull; -class XmlProblemFilter extends ProblemFilter { +@SuppressWarnings("SSBasedInspection") +final class XmlProblemFilter extends ProblemFilter { @Override public boolean shouldIgnore(@NotNull TextProblem problem) { if (isAfterPossibleEscape(problem)) return true; diff --git a/plugins/kotlin/base/analysis/kotlin.base.analysis.iml b/plugins/kotlin/base/analysis/kotlin.base.analysis.iml index e956a65ee244..f7831ebd1296 100644 --- a/plugins/kotlin/base/analysis/kotlin.base.analysis.iml +++ b/plugins/kotlin/base/analysis/kotlin.base.analysis.iml @@ -39,6 +39,7 @@ + diff --git a/plugins/kotlin/base/analysis/src/org/jetbrains/kotlin/idea/findUsages/similarity/KotlinSimilarityFeaturesExtractor.kt b/plugins/kotlin/base/analysis/src/org/jetbrains/kotlin/idea/findUsages/similarity/KotlinSimilarityFeaturesExtractor.kt index c85f43440822..f890c8484917 100644 --- a/plugins/kotlin/base/analysis/src/org/jetbrains/kotlin/idea/findUsages/similarity/KotlinSimilarityFeaturesExtractor.kt +++ b/plugins/kotlin/base/analysis/src/org/jetbrains/kotlin/idea/findUsages/similarity/KotlinSimilarityFeaturesExtractor.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.jetbrains.kotlin.idea.findUsages.similarity @@ -9,7 +9,7 @@ import com.intellij.usages.similarity.features.UsageSimilarityFeaturesRecorder import org.jetbrains.kotlin.builtins.StandardNames import org.jetbrains.kotlin.psi.* -class KotlinSimilarityFeaturesExtractor(element: PsiElement, private val context: PsiElement) : KtTreeVisitorVoid() { +internal class KotlinSimilarityFeaturesExtractor(element: PsiElement, private val context: PsiElement) : KtTreeVisitorVoid() { private val usageSimilarityFeaturesRecorder = UsageSimilarityFeaturesRecorder(context, element) private val variableNames = HashSet() diff --git a/plugins/kotlin/code-insight/impl-base/kotlin.code-insight.impl-base.iml b/plugins/kotlin/code-insight/impl-base/kotlin.code-insight.impl-base.iml index 2429ec5ef5d5..f56d84b9c02d 100644 --- a/plugins/kotlin/code-insight/impl-base/kotlin.code-insight.impl-base.iml +++ b/plugins/kotlin/code-insight/impl-base/kotlin.code-insight.impl-base.iml @@ -26,6 +26,7 @@ + diff --git a/plugins/kotlin/code-insight/impl-base/src/org/jetbrains/kotlin/idea/codeInsight/KotlinBreadcrumbsInfoProvider.kt b/plugins/kotlin/code-insight/impl-base/src/org/jetbrains/kotlin/idea/codeInsight/KotlinBreadcrumbsInfoProvider.kt index 1ec621b58995..2d62fdc4e4bf 100644 --- a/plugins/kotlin/code-insight/impl-base/src/org/jetbrains/kotlin/idea/codeInsight/KotlinBreadcrumbsInfoProvider.kt +++ b/plugins/kotlin/code-insight/impl-base/src/org/jetbrains/kotlin/idea/codeInsight/KotlinBreadcrumbsInfoProvider.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.jetbrains.kotlin.idea.codeInsight @@ -11,16 +11,16 @@ import com.intellij.refactoring.util.RefactoringDescriptionLocation import com.intellij.ui.breadcrumbs.BreadcrumbsProvider import com.intellij.usageView.UsageViewShortNameLocation import org.jetbrains.kotlin.KtNodeTypes -import org.jetbrains.kotlin.idea.base.resources.KotlinBundle import org.jetbrains.kotlin.idea.KotlinLanguage import org.jetbrains.kotlin.idea.base.psi.unwrapIfLabeled -import org.jetbrains.kotlin.util.match +import org.jetbrains.kotlin.idea.base.resources.KotlinBundle import org.jetbrains.kotlin.psi.* import org.jetbrains.kotlin.psi.psiUtil.getCallNameExpression import org.jetbrains.kotlin.psi.psiUtil.getQualifiedExpressionForSelector -import org.jetbrains.kotlin.renderer.render -import kotlin.reflect.KClass import org.jetbrains.kotlin.psi.psiUtil.parentsWithSelf +import org.jetbrains.kotlin.renderer.render +import org.jetbrains.kotlin.util.match +import kotlin.reflect.KClass class KotlinBreadcrumbsInfoProvider : BreadcrumbsProvider { override fun isShownByDefault(): Boolean = !UISettings.getInstance().showMembersInNavigationBar diff --git a/plugins/kotlin/code-insight/kotlin.code-insight.k2/kotlin.code-insight.k2.iml b/plugins/kotlin/code-insight/kotlin.code-insight.k2/kotlin.code-insight.k2.iml index 983647bf1a82..a606e37ccfcf 100644 --- a/plugins/kotlin/code-insight/kotlin.code-insight.k2/kotlin.code-insight.k2.iml +++ b/plugins/kotlin/code-insight/kotlin.code-insight.k2/kotlin.code-insight.k2.iml @@ -40,6 +40,7 @@ + diff --git a/plugins/kotlin/code-insight/kotlin.code-insight.k2/src/org/jetbrains/kotlin/idea/k2/codeinsight/hierarchy/overrides/KotlinOverrideHierarchyBrowser.kt b/plugins/kotlin/code-insight/kotlin.code-insight.k2/src/org/jetbrains/kotlin/idea/k2/codeinsight/hierarchy/overrides/KotlinOverrideHierarchyBrowser.kt index fdc5d9a1cd33..0bef0b166c9b 100644 --- a/plugins/kotlin/code-insight/kotlin.code-insight.k2/src/org/jetbrains/kotlin/idea/k2/codeinsight/hierarchy/overrides/KotlinOverrideHierarchyBrowser.kt +++ b/plugins/kotlin/code-insight/kotlin.code-insight.k2/src/org/jetbrains/kotlin/idea/k2/codeinsight/hierarchy/overrides/KotlinOverrideHierarchyBrowser.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.jetbrains.kotlin.idea.k2.codeinsight.hierarchy.overrides @@ -21,7 +21,7 @@ import org.jetbrains.kotlin.psi.KtDeclaration import javax.swing.JPanel import javax.swing.JTree -class KotlinOverrideHierarchyBrowser( +internal class KotlinOverrideHierarchyBrowser( project: Project, baseElement: PsiElement ) : MethodHierarchyBrowserBase(project, baseElement) { override fun createTrees(trees: MutableMap) { diff --git a/plugins/kotlin/coverage/kotlin.coverage.iml b/plugins/kotlin/coverage/kotlin.coverage.iml index 71bf7dc30452..ee790b8c628b 100644 --- a/plugins/kotlin/coverage/kotlin.coverage.iml +++ b/plugins/kotlin/coverage/kotlin.coverage.iml @@ -17,6 +17,7 @@ + diff --git a/plugins/kotlin/fir/tests/kotlin.fir.tests.iml b/plugins/kotlin/fir/tests/kotlin.fir.tests.iml index 6c7c3e82a254..279ce0422ba7 100644 --- a/plugins/kotlin/fir/tests/kotlin.fir.tests.iml +++ b/plugins/kotlin/fir/tests/kotlin.fir.tests.iml @@ -29,6 +29,7 @@ + diff --git a/plugins/kotlin/idea/kotlin.idea.iml b/plugins/kotlin/idea/kotlin.idea.iml index 13a631d4d47f..371ee5e8ac94 100644 --- a/plugins/kotlin/idea/kotlin.idea.iml +++ b/plugins/kotlin/idea/kotlin.idea.iml @@ -53,6 +53,7 @@ + diff --git a/plugins/kotlin/idea/tests/kotlin.idea.tests.iml b/plugins/kotlin/idea/tests/kotlin.idea.tests.iml index 45cf7250ebfd..1741d3eb66a4 100644 --- a/plugins/kotlin/idea/tests/kotlin.idea.tests.iml +++ b/plugins/kotlin/idea/tests/kotlin.idea.tests.iml @@ -28,7 +28,9 @@ + + diff --git a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/findUsages/AbstractFindUsagesTest.kt b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/findUsages/AbstractFindUsagesTest.kt index ad7a10b373d4..b0f15afe145a 100644 --- a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/findUsages/AbstractFindUsagesTest.kt +++ b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/findUsages/AbstractFindUsagesTest.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.jetbrains.kotlin.findUsages @@ -40,7 +40,6 @@ import com.intellij.usages.rules.UsageFilteringRule import com.intellij.usages.rules.UsageGroupingRule import com.intellij.util.CommonProcessors import org.jetbrains.kotlin.asJava.unwrapped -import org.jetbrains.kotlin.config.AnalysisFlag import org.jetbrains.kotlin.descriptors.DeclarationDescriptor import org.jetbrains.kotlin.executeOnPooledThreadInReadAction import org.jetbrains.kotlin.findUsages.AbstractFindUsagesTest.Companion.FindUsageTestType @@ -359,8 +358,10 @@ abstract class AbstractFindUsagesTest : KotlinLightCodeInsightFixtureTestCase(), }): Collection = InTextDirectivesUtils.findLinesWithPrefixesRemoved(mainFileText, directive).map { try { - mapper(Class.forName(it).getDeclaredConstructor().newInstance()) - } catch (e: Throwable) { + val declaredConstructor = Class.forName(it).getDeclaredConstructor() + declaredConstructor.isAccessible = true + mapper(declaredConstructor.newInstance()) + } catch (_: Throwable) { mapper(Class.forName(it).kotlin.objectInstance as Any) } } diff --git a/plugins/kotlin/kotlin.searching/base/kotlin.searching.base.iml b/plugins/kotlin/kotlin.searching/base/kotlin.searching.base.iml index 2d5a93da58ae..65eb96582187 100644 --- a/plugins/kotlin/kotlin.searching/base/kotlin.searching.base.iml +++ b/plugins/kotlin/kotlin.searching/base/kotlin.searching.base.iml @@ -26,6 +26,7 @@ + diff --git a/plugins/kotlin/kotlin.searching/base/src/org/jetbrains/kotlin/idea/base/searching/usages/KotlinDeclarationGroupRuleProvider.kt b/plugins/kotlin/kotlin.searching/base/src/org/jetbrains/kotlin/idea/base/searching/usages/KotlinDeclarationGroupRuleProvider.kt index 4d7d07b491d5..fcd96a2c7178 100644 --- a/plugins/kotlin/kotlin.searching/base/src/org/jetbrains/kotlin/idea/base/searching/usages/KotlinDeclarationGroupRuleProvider.kt +++ b/plugins/kotlin/kotlin.searching/base/src/org/jetbrains/kotlin/idea/base/searching/usages/KotlinDeclarationGroupRuleProvider.kt @@ -1,5 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.jetbrains.kotlin.idea.base.searching.usages import com.intellij.openapi.project.Project @@ -16,7 +15,7 @@ import org.jetbrains.kotlin.psi.KtScript import org.jetbrains.kotlin.psi.psiUtil.parents import org.jetbrains.kotlin.utils.addToStdlib.safeAs -class KotlinDeclarationGroupingRule(val level: Int = 0) : SingleParentUsageGroupingRule() { +internal class KotlinDeclarationGroupingRule(val level: Int = 0) : SingleParentUsageGroupingRule() { override fun getParentGroupFor(usage: Usage, targets: Array): UsageGroup? { var element = usage.safeAs()?.element ?: return null @@ -43,10 +42,10 @@ class KotlinDeclarationGroupingRule(val level: Int = 0) : SingleParentUsageGroup } } -class KotlinDeclarationGroupRuleProvider : FileStructureGroupRuleProvider { +private class KotlinDeclarationGroupRuleProvider : FileStructureGroupRuleProvider { override fun getUsageGroupingRule(project: Project): UsageGroupingRule = KotlinDeclarationGroupingRule(0) } -class KotlinDeclarationSecondLevelGroupRuleProvider : FileStructureGroupRuleProvider { +private class KotlinDeclarationSecondLevelGroupRuleProvider : FileStructureGroupRuleProvider { override fun getUsageGroupingRule(project: Project): UsageGroupingRule = KotlinDeclarationGroupingRule(1) } diff --git a/plugins/kotlin/kotlin.searching/kotlin.searching.test.k2/kotlin.searching.test.k2.iml b/plugins/kotlin/kotlin.searching/kotlin.searching.test.k2/kotlin.searching.test.k2.iml index ce035d02d4b1..294d34392dc8 100644 --- a/plugins/kotlin/kotlin.searching/kotlin.searching.test.k2/kotlin.searching.test.k2.iml +++ b/plugins/kotlin/kotlin.searching/kotlin.searching.test.k2/kotlin.searching.test.k2.iml @@ -17,6 +17,7 @@ + diff --git a/plugins/kotlin/performance-tests/kotlin.performance-tests.iml b/plugins/kotlin/performance-tests/kotlin.performance-tests.iml index 617e40f5a75a..9e85fb67cd68 100644 --- a/plugins/kotlin/performance-tests/kotlin.performance-tests.iml +++ b/plugins/kotlin/performance-tests/kotlin.performance-tests.iml @@ -17,6 +17,7 @@ + diff --git a/plugins/kotlin/refactorings/kotlin.refactorings.common/kotlin.refactorings.common.iml b/plugins/kotlin/refactorings/kotlin.refactorings.common/kotlin.refactorings.common.iml index 2976618255a6..377c558752cf 100644 --- a/plugins/kotlin/refactorings/kotlin.refactorings.common/kotlin.refactorings.common.iml +++ b/plugins/kotlin/refactorings/kotlin.refactorings.common/kotlin.refactorings.common.iml @@ -38,6 +38,7 @@ + diff --git a/plugins/kotlin/refactorings/kotlin.refactorings.k2/kotlin.refactorings.k2.iml b/plugins/kotlin/refactorings/kotlin.refactorings.k2/kotlin.refactorings.k2.iml index 5eac533d247c..1455ed3e69f3 100644 --- a/plugins/kotlin/refactorings/kotlin.refactorings.k2/kotlin.refactorings.k2.iml +++ b/plugins/kotlin/refactorings/kotlin.refactorings.k2/kotlin.refactorings.k2.iml @@ -25,6 +25,7 @@ + diff --git a/plugins/kotlin/refactorings/kotlin.refactorings.move.k2/kotlin.refactorings.move.k2.iml b/plugins/kotlin/refactorings/kotlin.refactorings.move.k2/kotlin.refactorings.move.k2.iml index 4e5e5973865d..81b66555bb15 100644 --- a/plugins/kotlin/refactorings/kotlin.refactorings.move.k2/kotlin.refactorings.move.k2.iml +++ b/plugins/kotlin/refactorings/kotlin.refactorings.move.k2/kotlin.refactorings.move.k2.iml @@ -50,6 +50,7 @@ + diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/annotator/MavenDomAnnotator.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/annotator/MavenDomAnnotator.java index 3a005b9d5a25..bf09777561ce 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/annotator/MavenDomAnnotator.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/annotator/MavenDomAnnotator.java @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.jetbrains.idea.maven.dom.annotator; import com.intellij.codeInspection.LocalQuickFix; @@ -23,7 +23,7 @@ import org.jetbrains.idea.maven.project.MavenProject; import java.util.Arrays; -public class MavenDomAnnotator implements DomElementsAnnotator { +public final class MavenDomAnnotator implements DomElementsAnnotator { @Override public void annotate(DomElement element, DomElementAnnotationHolder holder) { if (element instanceof MavenDomProjectModel) { diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/annotator/MavenDomGutterAnnotator.kt b/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/annotator/MavenDomGutterAnnotator.kt index 401521c3fd5f..a1f5e7082987 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/annotator/MavenDomGutterAnnotator.kt +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/annotator/MavenDomGutterAnnotator.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.jetbrains.idea.maven.dom.annotator import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder @@ -26,7 +26,7 @@ import org.jetbrains.idea.maven.dom.model.* import org.jetbrains.idea.maven.utils.MavenLog import javax.swing.Icon -class MavenDomGutterAnnotator : Annotator { +private class MavenDomGutterAnnotator : Annotator { override fun annotate(psiElement: PsiElement, holder: AnnotationHolder) { if (psiElement is XmlTag) { log { "MavenDomGutterAnnotator.annotate ${psiElement.name}" } diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/refactorings/introduce/IntroducePropertyAction.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/refactorings/introduce/IntroducePropertyAction.java index 1aa3865d60ae..b8221b552bcf 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/refactorings/introduce/IntroducePropertyAction.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/refactorings/introduce/IntroducePropertyAction.java @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.jetbrains.idea.maven.dom.refactorings.introduce; import com.intellij.find.FindManager; @@ -40,11 +40,11 @@ import org.jetbrains.idea.maven.statistics.MavenActionsUsagesCollector; import java.util.*; -public class IntroducePropertyAction extends BaseRefactoringAction { +final class IntroducePropertyAction extends BaseRefactoringAction { private static final String PREFIX = "${"; private static final String SUFFIX = "}"; - public IntroducePropertyAction() { + IntroducePropertyAction() { setInjectedContext(true); } diff --git a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/refactoring/rename/ResourceBundleRenamer.java b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/refactoring/rename/ResourceBundleRenamer.java index 761737eb5ac6..8e81aa0f0c6a 100644 --- a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/refactoring/rename/ResourceBundleRenamer.java +++ b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/refactoring/rename/ResourceBundleRenamer.java @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.lang.properties.refactoring.rename; import com.intellij.lang.properties.PropertiesBundle; @@ -13,8 +13,7 @@ import org.jetbrains.annotations.NonNls; /** * @author Dmitry Batkovich */ -public class ResourceBundleRenamer extends AutomaticRenamer { - +public final class ResourceBundleRenamer extends AutomaticRenamer { private final ResourceBundleManager myResourceBundleManager; private final String myOldBaseName; diff --git a/plugins/properties/properties-resource-bundle-editor/src/com/intellij/lang/properties/editor/ResourceBundleStructureViewComponent.java b/plugins/properties/properties-resource-bundle-editor/src/com/intellij/lang/properties/editor/ResourceBundleStructureViewComponent.java index 68399ec29568..5c18345edf91 100644 --- a/plugins/properties/properties-resource-bundle-editor/src/com/intellij/lang/properties/editor/ResourceBundleStructureViewComponent.java +++ b/plugins/properties/properties-resource-bundle-editor/src/com/intellij/lang/properties/editor/ResourceBundleStructureViewComponent.java @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.lang.properties.editor; import com.intellij.find.findUsages.PsiElement2UsageTargetAdapter; @@ -36,7 +36,7 @@ import java.awt.datatransfer.StringSelection; import java.util.ArrayList; import java.util.List; -public class ResourceBundleStructureViewComponent extends PropertiesGroupingStructureViewComponent { +public final class ResourceBundleStructureViewComponent extends PropertiesGroupingStructureViewComponent { private static final Logger LOG = Logger.getInstance(ResourceBundleStructureViewComponent.class); private final ResourceBundle myResourceBundle; diff --git a/plugins/properties/src/com/intellij/lang/properties/PropertiesDescriptionProvider.java b/plugins/properties/src/com/intellij/lang/properties/PropertiesDescriptionProvider.java index 6ca30c5677d8..e95a4161723a 100644 --- a/plugins/properties/src/com/intellij/lang/properties/PropertiesDescriptionProvider.java +++ b/plugins/properties/src/com/intellij/lang/properties/PropertiesDescriptionProvider.java @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.lang.properties; import com.intellij.ide.IdeBundle; @@ -10,8 +10,7 @@ import com.intellij.usageView.UsageViewLongNameLocation; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; - -public class PropertiesDescriptionProvider implements ElementDescriptionProvider { +final class PropertiesDescriptionProvider implements ElementDescriptionProvider { @Override public String getElementDescription(final @NotNull PsiElement element, final @Nullable ElementDescriptionLocation location) { if (element instanceof IProperty) { diff --git a/plugins/properties/src/com/intellij/lang/properties/refactoring/PropertyKeysSafeDeleteProcessor.java b/plugins/properties/src/com/intellij/lang/properties/refactoring/PropertyKeysSafeDeleteProcessor.java index ab8b269367c6..0c7622e437fe 100644 --- a/plugins/properties/src/com/intellij/lang/properties/refactoring/PropertyKeysSafeDeleteProcessor.java +++ b/plugins/properties/src/com/intellij/lang/properties/refactoring/PropertyKeysSafeDeleteProcessor.java @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.lang.properties.refactoring; import com.intellij.lang.properties.IProperty; @@ -20,15 +20,11 @@ import java.util.Collection; import java.util.Collections; import java.util.List; -/** - * @author Dmitry Batkovich - */ -public class PropertyKeysSafeDeleteProcessor extends SafeDeleteProcessorDelegateBase { - +final class PropertyKeysSafeDeleteProcessor extends SafeDeleteProcessorDelegateBase { @Override - public @Nullable Collection getElementsToSearch(@NotNull PsiElement element, - @Nullable Module module, - @NotNull Collection allElementsToDelete) { + public @NotNull Collection getElementsToSearch(@NotNull PsiElement element, + @Nullable Module module, + @NotNull Collection allElementsToDelete) { return Collections.singleton(element); } @@ -38,7 +34,7 @@ public class PropertyKeysSafeDeleteProcessor extends SafeDeleteProcessorDelegate } @Override - public @Nullable NonCodeUsageSearchInfo findUsages(@NotNull PsiElement element, PsiElement @NotNull [] allElementsToDelete, @NotNull List result) { + public @NotNull NonCodeUsageSearchInfo findUsages(@NotNull PsiElement element, PsiElement @NotNull [] allElementsToDelete, @NotNull List result) { SafeDeleteProcessor.findGenericElementUsages(element, result, allElementsToDelete); return new NonCodeUsageSearchInfo(SafeDeleteProcessor.getDefaultInsideDeletedCondition(allElementsToDelete), element); } diff --git a/plugins/rareJavaRefactorings/src/com/intellij/refactoring/typeCook/TypeCookViewDescriptor.java b/plugins/rareJavaRefactorings/src/com/intellij/refactoring/typeCook/TypeCookViewDescriptor.java index 6185dc42f67a..4639aebaf7c2 100644 --- a/plugins/rareJavaRefactorings/src/com/intellij/refactoring/typeCook/TypeCookViewDescriptor.java +++ b/plugins/rareJavaRefactorings/src/com/intellij/refactoring/typeCook/TypeCookViewDescriptor.java @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.refactoring.typeCook; import com.intellij.psi.PsiElement; @@ -7,7 +7,7 @@ import com.intellij.usageView.UsageViewBundle; import com.intellij.usageView.UsageViewDescriptor; import org.jetbrains.annotations.NotNull; -class TypeCookViewDescriptor implements UsageViewDescriptor { +final class TypeCookViewDescriptor implements UsageViewDescriptor { private final PsiElement[] myElements; TypeCookViewDescriptor(PsiElement[] elements) { diff --git a/plugins/search-everywhere-ml/ranking/core/src/com/intellij/searchEverywhereMl/ranking/core/features/SearchEverywhereStateFeaturesProvider.kt b/plugins/search-everywhere-ml/ranking/core/src/com/intellij/searchEverywhereMl/ranking/core/features/SearchEverywhereStateFeaturesProvider.kt index de88c60cde94..15b481e44be3 100644 --- a/plugins/search-everywhere-ml/ranking/core/src/com/intellij/searchEverywhereMl/ranking/core/features/SearchEverywhereStateFeaturesProvider.kt +++ b/plugins/search-everywhere-ml/ranking/core/src/com/intellij/searchEverywhereMl/ranking/core/features/SearchEverywhereStateFeaturesProvider.kt @@ -13,8 +13,7 @@ import com.intellij.openapi.project.DumbService import com.intellij.openapi.project.Project import com.intellij.usages.impl.ScopeRuleValidator - -class SearchEverywhereStateFeaturesProvider { +internal class SearchEverywhereStateFeaturesProvider { companion object { internal val QUERY_LENGTH_DATA_KEY = EventFields.Int("queryLength") internal val IS_EMPTY_QUERY_DATA_KEY = EventFields.Boolean("isEmptyQuery") diff --git a/plugins/sh/core/src/com/intellij/sh/rename/ShRenameHandler.java b/plugins/sh/core/src/com/intellij/sh/rename/ShRenameHandler.java index 946546c14a10..2cd72bf96bfb 100644 --- a/plugins/sh/core/src/com/intellij/sh/rename/ShRenameHandler.java +++ b/plugins/sh/core/src/com/intellij/sh/rename/ShRenameHandler.java @@ -19,7 +19,7 @@ import com.intellij.sh.psi.ShFunctionDefinition; import com.intellij.util.ObjectUtils; import org.jetbrains.annotations.NotNull; -public class ShRenameHandler implements RenameHandler { +final class ShRenameHandler implements RenameHandler { @Override public boolean isAvailableOnDataContext(@NotNull DataContext dataContext) { Editor editor = dataContext.getData(CommonDataKeys.EDITOR); diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XPathLanguageInjector.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XPathLanguageInjector.java index 440a63502b8b..3b8c001b54cc 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XPathLanguageInjector.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XPathLanguageInjector.java @@ -37,7 +37,7 @@ import org.jetbrains.annotations.Nullable; import java.util.Collections; import java.util.List; -public class XPathLanguageInjector implements MultiHostInjector { +final class XPathLanguageInjector implements MultiHostInjector { private static final Key> CACHED_FILES = Key.create("CACHED_FILES"); public XPathLanguageInjector() { diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XsltStuffProvider.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XsltStuffProvider.java index da6b0392c4a0..ca01fcdfb37f 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XsltStuffProvider.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XsltStuffProvider.java @@ -42,7 +42,7 @@ import org.jetbrains.annotations.Nullable; import javax.swing.*; import javax.xml.namespace.QName; -public class XsltStuffProvider implements UsageGroupingRuleProvider { +public final class XsltStuffProvider implements UsageGroupingRuleProvider { @SuppressWarnings({"unchecked"}) public static final Class[] INSPECTION_CLASSES = new Class[]{ diff --git a/plugins/xslt-debugger/src/org/intellij/plugins/xsltDebugger/impl/XsltBreakpointHandler.java b/plugins/xslt-debugger/src/org/intellij/plugins/xsltDebugger/impl/XsltBreakpointHandler.java index 7f44f91514a4..00ec89e6d7cd 100644 --- a/plugins/xslt-debugger/src/org/intellij/plugins/xsltDebugger/impl/XsltBreakpointHandler.java +++ b/plugins/xslt-debugger/src/org/intellij/plugins/xsltDebugger/impl/XsltBreakpointHandler.java @@ -1,11 +1,11 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.intellij.plugins.xsltDebugger.impl; import com.intellij.lang.ASTNode; import com.intellij.openapi.editor.Document; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.MessageType; -import com.intellij.openapi.vfs.VfsUtil; +import com.intellij.openapi.vfs.VfsUtilCore; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiElement; @@ -28,10 +28,10 @@ import org.intellij.plugins.xsltDebugger.rt.engine.DebuggerStoppedException; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -public class XsltBreakpointHandler extends XBreakpointHandler> { +public final class XsltBreakpointHandler extends XBreakpointHandler> { private final XsltDebugProcess myXsltDebugProcess; - public XsltBreakpointHandler(XsltDebugProcess xsltDebugProcess, final Class typeClass) { + public XsltBreakpointHandler(XsltDebugProcess xsltDebugProcess, final Class typeClass) { super(typeClass); myXsltDebugProcess = xsltDebugProcess; } @@ -70,7 +70,7 @@ public class XsltBreakpointHandler extends XBreakpointHandler getPattern() { return psiElement(YAMLAnchor.class); diff --git a/python/python-features-trainer/src/com/intellij/python/featuresTrainer/ift/lesson/refactorings/PythonRenameLesson.kt b/python/python-features-trainer/src/com/intellij/python/featuresTrainer/ift/lesson/refactorings/PythonRenameLesson.kt index 6de7027307da..11fe8ca39d91 100644 --- a/python/python-features-trainer/src/com/intellij/python/featuresTrainer/ift/lesson/refactorings/PythonRenameLesson.kt +++ b/python/python-features-trainer/src/com/intellij/python/featuresTrainer/ift/lesson/refactorings/PythonRenameLesson.kt @@ -3,12 +3,12 @@ package com.intellij.python.featuresTrainer.ift.lesson.refactorings import com.intellij.ide.DataManager import com.intellij.ide.actions.exclusion.ExclusionHandler +import com.intellij.python.featuresTrainer.ift.PythonLessonsBundle import com.intellij.refactoring.RefactoringBundle import com.intellij.refactoring.ui.NameSuggestionsField import com.intellij.ui.tree.TreeVisitor import com.intellij.usageView.UsageViewBundle import com.intellij.util.ui.tree.TreeUtil -import com.intellij.python.featuresTrainer.ift.PythonLessonsBundle import org.assertj.swing.fixture.JTreeFixture import training.dsl.* import training.learn.LessonsBundle @@ -18,7 +18,7 @@ import javax.swing.JButton import javax.swing.JTree import javax.swing.tree.TreePath -class PythonRenameLesson : KLesson("Rename", LessonsBundle.message("rename.lesson.name")) { +internal class PythonRenameLesson : KLesson("Rename", LessonsBundle.message("rename.lesson.name")) { override val testScriptProperties = TaskTestContext.TestScriptProperties(10) private val template = """ class Championship: diff --git a/spellchecker/src/com/intellij/spellchecker/quickfixes/RenameTo.java b/spellchecker/src/com/intellij/spellchecker/quickfixes/RenameTo.java index 8e9839e77729..932ce2768cef 100644 --- a/spellchecker/src/com/intellij/spellchecker/quickfixes/RenameTo.java +++ b/spellchecker/src/com/intellij/spellchecker/quickfixes/RenameTo.java @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.spellchecker.quickfixes; import com.intellij.modcommand.ModPsiUpdater; diff --git a/xml/impl/src/com/intellij/xml/refactoring/XmlTagRenameDialog.java b/xml/impl/src/com/intellij/xml/refactoring/XmlTagRenameDialog.java index d8bf98b5f64a..72aa8d5cd4a9 100644 --- a/xml/impl/src/com/intellij/xml/refactoring/XmlTagRenameDialog.java +++ b/xml/impl/src/com/intellij/xml/refactoring/XmlTagRenameDialog.java @@ -1,4 +1,4 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.xml.refactoring; import com.intellij.codeInsight.completion.TagNameReferenceCompletionProvider; @@ -31,7 +31,7 @@ import java.awt.event.ActionListener; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; -public class XmlTagRenameDialog extends RefactoringDialog { +public final class XmlTagRenameDialog extends RefactoringDialog { private static final Logger LOG = Logger.getInstance(XmlTagRenameDialog.class); private final PsiElement myElement; diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/references/PrefixReferenceProvider.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/references/PrefixReferenceProvider.java index dca388a6296e..7068963bc15d 100644 --- a/xml/relaxng/src/org/intellij/plugins/relaxNG/references/PrefixReferenceProvider.java +++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/references/PrefixReferenceProvider.java @@ -21,7 +21,6 @@ import com.intellij.codeInspection.LocalQuickFix; import com.intellij.codeInspection.LocalQuickFixProvider; import com.intellij.codeInspection.XmlQuickFixFactory; import com.intellij.lang.xml.XMLLanguage; -import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiReference; @@ -38,9 +37,7 @@ import org.intellij.plugins.relaxNG.RelaxngBundle; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -public class PrefixReferenceProvider extends PsiReferenceProvider { - private static final Logger LOG = Logger.getInstance(PrefixReferenceProvider.class); - +public final class PrefixReferenceProvider extends PsiReferenceProvider { @Override public PsiReference @NotNull [] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) { final XmlAttributeValue value = (XmlAttributeValue)element; diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/validation/Psi2SaxAdapter.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/validation/Psi2SaxAdapter.java index fe248f0f9a48..06512cf4a652 100644 --- a/xml/relaxng/src/org/intellij/plugins/relaxNG/validation/Psi2SaxAdapter.java +++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/validation/Psi2SaxAdapter.java @@ -35,7 +35,7 @@ import org.xml.sax.ext.Locator2Impl; import java.util.Map; -class Psi2SaxAdapter extends XmlElementVisitor implements PsiElementProcessor { +final class Psi2SaxAdapter extends XmlElementVisitor implements PsiElementProcessor { private final ContentHandler myHandler; Psi2SaxAdapter(ContentHandler handler) { diff --git a/xml/xml-analysis-impl/src/com/intellij/xml/XmlCustomTagHighlightingPass.kt b/xml/xml-analysis-impl/src/com/intellij/xml/XmlCustomTagHighlightingPass.kt index fcc98980909b..57b92b8ae9c1 100644 --- a/xml/xml-analysis-impl/src/com/intellij/xml/XmlCustomTagHighlightingPass.kt +++ b/xml/xml-analysis-impl/src/com/intellij/xml/XmlCustomTagHighlightingPass.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.xml import com.intellij.codeHighlighting.TextEditorHighlightingPass @@ -32,13 +32,12 @@ import com.intellij.psi.xml.XmlTag import com.intellij.xml.impl.schema.AnyXmlElementDescriptor import com.intellij.xml.util.HtmlUtil -val attributeKeyMapping: Map = mapOf( +private val attributeKeyMapping: Map = mapOf( XmlHighlighterColors.HTML_TAG_NAME to XmlHighlighterColors.HTML_CUSTOM_TAG_NAME, XmlHighlighterColors.XML_TAG_NAME to XmlHighlighterColors.XML_CUSTOM_TAG_NAME ) -class XmlCustomTagHighlightingPass(val file: PsiFile, editor: Editor) : TextEditorHighlightingPass(file.project, editor.document, true) { - +internal class XmlCustomTagHighlightingPass(val file: PsiFile, editor: Editor) : TextEditorHighlightingPass(file.project, editor.document, true) { private val myHolder: HighlightInfoHolder = HighlightInfoHolder(file) private val myHighlighter = SyntaxHighlighterFactory.getSyntaxHighlighter(file.language, file.project, file.virtualFile)