diff --git a/RegExpSupport/src/org/intellij/lang/regexp/inspection/custom/CustomRegExpInspection.java b/RegExpSupport/src/org/intellij/lang/regexp/inspection/custom/CustomRegExpInspection.java index bdb3b2d8c4be..861eaf377be4 100644 --- a/RegExpSupport/src/org/intellij/lang/regexp/inspection/custom/CustomRegExpInspection.java +++ b/RegExpSupport/src/org/intellij/lang/regexp/inspection/custom/CustomRegExpInspection.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.lang.regexp.inspection.custom; import com.intellij.codeInsight.daemon.HighlightDisplayKey; @@ -34,12 +34,10 @@ import org.jetbrains.annotations.Nullable; import java.util.List; import java.util.function.Function; -import static com.intellij.codeInspection.ProblemHighlightType.GENERIC_ERROR_OR_WARNING; - /** * @author Bas Leijdekkers */ -public class CustomRegExpInspection extends LocalInspectionTool implements DynamicGroupTool { +public final class CustomRegExpInspection extends LocalInspectionTool implements DynamicGroupTool { public static final String SHORT_NAME = "CustomRegExpInspection"; public final List myConfigurations = new SmartList<>(); @@ -111,7 +109,7 @@ public class CustomRegExpInspection extends LocalInspectionTool implements Dynam final String problemDescriptor = StringUtil.defaultIfEmpty(configuration.getProblemDescriptor(), configuration.getName()); final CustomRegExpQuickFix fix = replacement == null ? null : new CustomRegExpQuickFix(findManager, model, text, result); final ProblemDescriptor descriptor = - manager.createProblemDescriptor(element, warningRange, problemDescriptor, GENERIC_ERROR_OR_WARNING, isOnTheFly, fix); + manager.createProblemDescriptor(element, warningRange, problemDescriptor, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, isOnTheFly, fix); descriptors.add(new ProblemDescriptorWithReporterName((ProblemDescriptorBase)descriptor, uuid)); result = findManager.findString(text, result.getEndOffset(), model, vFile); } diff --git a/aether-dependency-resolver/testSrc/org/jetbrains/idea/maven/aether/ArtifactRepositoryManagerTest.java b/aether-dependency-resolver/testSrc/org/jetbrains/idea/maven/aether/ArtifactRepositoryManagerTest.java index eda2bd39e319..45d4ea81a482 100644 --- a/aether-dependency-resolver/testSrc/org/jetbrains/idea/maven/aether/ArtifactRepositoryManagerTest.java +++ b/aether-dependency-resolver/testSrc/org/jetbrains/idea/maven/aether/ArtifactRepositoryManagerTest.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 org.jetbrains.idea.maven.aether; import com.intellij.openapi.util.io.FileUtil; @@ -31,7 +17,6 @@ import java.util.Collections; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; -import java.util.zip.ZipFile; public class ArtifactRepositoryManagerTest extends UsefulTestCase { private static final RemoteRepository mavenLocal; diff --git a/java/java-impl-inspections/src/com/intellij/codeInspection/classCanBeRecord/ConvertToRecordProcessor.java b/java/java-impl-inspections/src/com/intellij/codeInspection/classCanBeRecord/ConvertToRecordProcessor.java index 1518de99489e..f779c164aa51 100644 --- a/java/java-impl-inspections/src/com/intellij/codeInspection/classCanBeRecord/ConvertToRecordProcessor.java +++ b/java/java-impl-inspections/src/com/intellij/codeInspection/classCanBeRecord/ConvertToRecordProcessor.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.codeInspection.classCanBeRecord; import com.intellij.codeInspection.RedundantRecordConstructorInspection; @@ -7,6 +7,7 @@ import com.intellij.codeInspection.classCanBeRecord.ConvertToRecordFix.FieldAcce import com.intellij.codeInspection.classCanBeRecord.ConvertToRecordFix.RecordCandidate; import com.intellij.java.refactoring.JavaRefactoringBundle; import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.util.NlsContexts; import com.intellij.openapi.util.Ref; import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.*; @@ -39,11 +40,7 @@ import org.jetbrains.annotations.Nullable; import java.util.*; -import static com.intellij.openapi.util.NlsContexts.Command; -import static com.intellij.openapi.util.NlsContexts.DialogMessage; -import static com.intellij.psi.PsiModifier.PRIVATE; - -class ConvertToRecordProcessor extends BaseRefactoringProcessor { +final class ConvertToRecordProcessor extends BaseRefactoringProcessor { private static final CallMatcher OBJECT_EQUALS = CallMatcher.instanceCall(CommonClassNames.JAVA_LANG_OBJECT, "equals") .parameterTypes(CommonClassNames.JAVA_LANG_OBJECT); private static final CallMatcher OBJECT_HASHCODE = @@ -101,7 +98,7 @@ class ConvertToRecordProcessor extends BaseRefactoringProcessor { protected UsageInfo @NotNull [] findUsages() { List usages = new SmartList<>(); for (var psiField : myRecordCandidate.getFieldAccessors().keySet()) { - if (!psiField.hasModifierProperty(PRIVATE)) { + if (!psiField.hasModifierProperty(PsiModifier.PRIVATE)) { for (PsiReference reference : ReferencesSearch.search(psiField)) { usages.add(new FieldUsageInfo(psiField, reference)); } @@ -196,7 +193,7 @@ class ConvertToRecordProcessor extends BaseRefactoringProcessor { @Override protected boolean preprocessUsages(@NotNull Ref refUsages) { final UsageInfo[] usages = refUsages.get(); - MultiMap conflicts = new MultiMap<>(); + MultiMap conflicts = new MultiMap<>(); RenameUtil.addConflictDescriptions(usages, conflicts); for (UsageInfo usage : usages) { if (usage instanceof BrokenEncapsulationUsageInfo) { @@ -313,7 +310,7 @@ class ConvertToRecordProcessor extends BaseRefactoringProcessor { private boolean isAccessible(@NotNull PsiElement place, @NotNull PsiField psiField) { return JavaPsiFacade.getInstance(myProject).getResolveHelper() - .isAccessible(psiField, new LightModifierList(psiField.getManager(), psiField.getLanguage(), PRIVATE), + .isAccessible(psiField, new LightModifierList(psiField.getManager(), psiField.getLanguage(), PsiModifier.PRIVATE), place, null, null); } @@ -498,7 +495,7 @@ class ConvertToRecordProcessor extends BaseRefactoringProcessor { } @Override - protected @NotNull @Command String getCommandName() { + protected @NotNull @NlsContexts.Command String getCommandName() { return JavaRefactoringBundle.message("convert.to.record.title"); } diff --git a/java/java-impl-refactorings/src/com/intellij/refactoring/extractclass/ExtractClassUsageViewDescriptor.java b/java/java-impl-refactorings/src/com/intellij/refactoring/extractclass/ExtractClassUsageViewDescriptor.java index 857e4b7d9781..206fc22aac93 100644 --- a/java/java-impl-refactorings/src/com/intellij/refactoring/extractclass/ExtractClassUsageViewDescriptor.java +++ b/java/java-impl-refactorings/src/com/intellij/refactoring/extractclass/ExtractClassUsageViewDescriptor.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.extractclass; import com.intellij.psi.PsiClass; @@ -7,7 +7,7 @@ import com.intellij.refactoring.RefactorJBundle; import com.intellij.usageView.UsageViewDescriptor; import org.jetbrains.annotations.NotNull; -class ExtractClassUsageViewDescriptor implements UsageViewDescriptor { +final class ExtractClassUsageViewDescriptor implements UsageViewDescriptor { private final PsiClass aClass; ExtractClassUsageViewDescriptor(PsiClass aClass) { diff --git a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/CollapseAllRegionsAction.java b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/CollapseAllRegionsAction.java index 545d3a462330..a7f2339ac47e 100644 --- a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/CollapseAllRegionsAction.java +++ b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/CollapseAllRegionsAction.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.folding.impl.actions; import com.intellij.openapi.actionSystem.DataContext; @@ -8,15 +7,13 @@ import com.intellij.openapi.editor.Caret; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.FoldRegion; import com.intellij.openapi.editor.actionSystem.EditorAction; -import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.List; -@ApiStatus.Internal -public final class CollapseAllRegionsAction extends EditorAction implements ActionRemoteBehaviorSpecification.Frontend { - public CollapseAllRegionsAction() { +final class CollapseAllRegionsAction extends EditorAction implements ActionRemoteBehaviorSpecification.Frontend { + CollapseAllRegionsAction() { super(new BaseFoldingHandler() { @Override public void doExecute(final @NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { diff --git a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/CollapseBlockAction.java b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/CollapseBlockAction.java index 60f52eb7fe48..9fa59c80c2f2 100644 --- a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/CollapseBlockAction.java +++ b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/CollapseBlockAction.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.folding.impl.actions; import com.intellij.codeInsight.CodeInsightActionHandler; @@ -9,13 +9,11 @@ import com.intellij.lang.injection.InjectedLanguageManager; 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; import java.util.List; -@ApiStatus.Internal -public final class CollapseBlockAction extends BaseCodeInsightAction { +final class CollapseBlockAction extends BaseCodeInsightAction { @Override protected @NotNull CodeInsightActionHandler getHandler() { return new CodeInsightActionHandler() { diff --git a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/CollapseRegionAction.java b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/CollapseRegionAction.java index cccc366ac324..06c53bc831d8 100644 --- a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/CollapseRegionAction.java +++ b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/CollapseRegionAction.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.folding.impl.actions; import com.intellij.codeInsight.folding.impl.FoldingUtil; @@ -9,12 +8,10 @@ import com.intellij.openapi.editor.Caret; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.FoldRegion; import com.intellij.openapi.editor.actionSystem.EditorAction; -import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -@ApiStatus.Internal -public final class CollapseRegionAction extends EditorAction implements ActionRemoteBehaviorSpecification.Frontend { +final class CollapseRegionAction extends EditorAction implements ActionRemoteBehaviorSpecification.Frontend { public CollapseRegionAction() { super(new BaseFoldingHandler() { @Override diff --git a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/CollapseRegionRecursivelyAction.java b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/CollapseRegionRecursivelyAction.java index c5dcf0548ed6..f283eee7b2b7 100644 --- a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/CollapseRegionRecursivelyAction.java +++ b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/CollapseRegionRecursivelyAction.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.folding.impl.actions; import com.intellij.openapi.actionSystem.DataContext; @@ -13,7 +13,7 @@ import org.jetbrains.annotations.Nullable; import java.util.List; final class CollapseRegionRecursivelyAction extends EditorAction implements ActionRemoteBehaviorSpecification.Frontend { - public CollapseRegionRecursivelyAction() { + CollapseRegionRecursivelyAction() { super(new BaseFoldingHandler() { @Override public void doExecute(final @NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { diff --git a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/CollapseSelectionAction.java b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/CollapseSelectionAction.java index c8c41bc515b8..0c7257b0a379 100644 --- a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/CollapseSelectionAction.java +++ b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/CollapseSelectionAction.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.folding.impl.actions; @@ -11,11 +11,9 @@ import com.intellij.openapi.editor.ex.util.EditorUtil; import com.intellij.openapi.project.DumbAware; 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 CollapseSelectionAction extends BaseCodeInsightAction implements DumbAware { +final class CollapseSelectionAction extends BaseCodeInsightAction implements DumbAware { @Override protected @NotNull CodeInsightActionHandler getHandler() { return new CollapseSelectionHandler(); diff --git a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllRegionsAction.java b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllRegionsAction.java index 498f7a8c46a2..320490f11030 100644 --- a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllRegionsAction.java +++ b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllRegionsAction.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.folding.impl.actions; diff --git a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllToLevel1Action.java b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllToLevel1Action.java index 0599290a9467..14375d178831 100644 --- a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllToLevel1Action.java +++ b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllToLevel1Action.java @@ -1,11 +1,8 @@ -// 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.codeInsight.folding.impl.actions; -import org.jetbrains.annotations.ApiStatus; - -@ApiStatus.Internal -public final class ExpandAllToLevel1Action extends BaseExpandToLevelAction { - public ExpandAllToLevel1Action() { +final class ExpandAllToLevel1Action extends BaseExpandToLevelAction { + ExpandAllToLevel1Action() { super(1, true); } } diff --git a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllToLevel2Action.java b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllToLevel2Action.java index 9434144d80f0..e0fce87719cf 100644 --- a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllToLevel2Action.java +++ b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllToLevel2Action.java @@ -1,11 +1,8 @@ -// 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.codeInsight.folding.impl.actions; -import org.jetbrains.annotations.ApiStatus; - -@ApiStatus.Internal -public final class ExpandAllToLevel2Action extends BaseExpandToLevelAction { - public ExpandAllToLevel2Action() { +final class ExpandAllToLevel2Action extends BaseExpandToLevelAction { + ExpandAllToLevel2Action() { super(2, true); } } diff --git a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllToLevel3Action.java b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllToLevel3Action.java index da586e4335de..fe2874ef8404 100644 --- a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllToLevel3Action.java +++ b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllToLevel3Action.java @@ -1,11 +1,8 @@ -// 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.codeInsight.folding.impl.actions; -import org.jetbrains.annotations.ApiStatus; - -@ApiStatus.Internal -public final class ExpandAllToLevel3Action extends BaseExpandToLevelAction { - public ExpandAllToLevel3Action() { +final class ExpandAllToLevel3Action extends BaseExpandToLevelAction { + ExpandAllToLevel3Action() { super(3, true); } } diff --git a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllToLevel4Action.java b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllToLevel4Action.java index cdc8d73eb042..130a3636168c 100644 --- a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllToLevel4Action.java +++ b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllToLevel4Action.java @@ -1,10 +1,7 @@ -// 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.codeInsight.folding.impl.actions; -import org.jetbrains.annotations.ApiStatus; - -@ApiStatus.Internal -public final class ExpandAllToLevel4Action extends BaseExpandToLevelAction { +final class ExpandAllToLevel4Action extends BaseExpandToLevelAction { public ExpandAllToLevel4Action() { super(4, true); } diff --git a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllToLevel5Action.java b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllToLevel5Action.java index 5a8193bb1e7a..2fa76c7024d8 100644 --- a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllToLevel5Action.java +++ b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandAllToLevel5Action.java @@ -1,11 +1,8 @@ -// 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.codeInsight.folding.impl.actions; -import org.jetbrains.annotations.ApiStatus; - -@ApiStatus.Internal -public final class ExpandAllToLevel5Action extends BaseExpandToLevelAction { - public ExpandAllToLevel5Action() { +final class ExpandAllToLevel5Action extends BaseExpandToLevelAction { + ExpandAllToLevel5Action() { super(5, true); } } diff --git a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandCollapseToggleAction.kt b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandCollapseToggleAction.kt index 6319a524639a..47a37209a543 100644 --- a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandCollapseToggleAction.kt +++ b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandCollapseToggleAction.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 com.intellij.codeInsight.folding.impl.actions import com.intellij.codeInsight.folding.impl.FoldingUtil @@ -8,10 +8,8 @@ import com.intellij.openapi.editor.Caret import com.intellij.openapi.editor.Editor import com.intellij.openapi.editor.FoldRegion import com.intellij.openapi.editor.actionSystem.EditorAction -import org.jetbrains.annotations.ApiStatus -@ApiStatus.Internal -class ExpandCollapseToggleAction : EditorAction(object : BaseFoldingHandler() { +private class ExpandCollapseToggleAction : EditorAction(object : BaseFoldingHandler() { override fun doExecute(editor: Editor, caret: Caret?, dataContext: DataContext?) { val line = editor.caretModel.logicalPosition.line diff --git a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandRegionAction.java b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandRegionAction.java index a72a690aad5d..f789354a899a 100644 --- a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandRegionAction.java +++ b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandRegionAction.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.folding.impl.actions; import com.intellij.codeInsight.folding.impl.FoldingUtil; @@ -15,7 +14,7 @@ import org.jetbrains.annotations.Nullable; @ApiStatus.Internal public final class ExpandRegionAction extends EditorAction implements ActionRemoteBehaviorSpecification.Frontend { - public ExpandRegionAction() { + ExpandRegionAction() { super(new BaseFoldingHandler() { @Override public void doExecute(@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { diff --git a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandRegionRecursivelyAction.java b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandRegionRecursivelyAction.java index 76487debb943..56826c369a67 100644 --- a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandRegionRecursivelyAction.java +++ b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandRegionRecursivelyAction.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.folding.impl.actions; import com.intellij.openapi.actionSystem.DataContext; @@ -7,15 +7,13 @@ import com.intellij.openapi.editor.Caret; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.FoldRegion; import com.intellij.openapi.editor.actionSystem.EditorAction; -import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.List; -@ApiStatus.Internal -public final class ExpandRegionRecursivelyAction extends EditorAction implements ActionRemoteBehaviorSpecification.Frontend { - public ExpandRegionRecursivelyAction() { +final class ExpandRegionRecursivelyAction extends EditorAction implements ActionRemoteBehaviorSpecification.Frontend { + ExpandRegionRecursivelyAction() { super(new BaseFoldingHandler() { @Override public void doExecute(final @NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { diff --git a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandToLevel1Action.java b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandToLevel1Action.java index d242ab224160..85764250c5d7 100644 --- a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandToLevel1Action.java +++ b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandToLevel1Action.java @@ -1,11 +1,8 @@ -// 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.codeInsight.folding.impl.actions; -import org.jetbrains.annotations.ApiStatus; - -@ApiStatus.Internal -public final class ExpandToLevel1Action extends BaseExpandToLevelAction { - public ExpandToLevel1Action() { +final class ExpandToLevel1Action extends BaseExpandToLevelAction { + ExpandToLevel1Action() { super(1, false); } } diff --git a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandToLevel2Action.java b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandToLevel2Action.java index 5c336b73ef73..5a1c02ab1e98 100644 --- a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandToLevel2Action.java +++ b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandToLevel2Action.java @@ -1,11 +1,8 @@ -// 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.codeInsight.folding.impl.actions; -import org.jetbrains.annotations.ApiStatus; - -@ApiStatus.Internal -public final class ExpandToLevel2Action extends BaseExpandToLevelAction { - public ExpandToLevel2Action() { +final class ExpandToLevel2Action extends BaseExpandToLevelAction { + ExpandToLevel2Action() { super(2, false); } } diff --git a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandToLevel3Action.java b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandToLevel3Action.java index 3c111d0a9685..3630ed27e726 100644 --- a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandToLevel3Action.java +++ b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandToLevel3Action.java @@ -1,11 +1,8 @@ -// 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.codeInsight.folding.impl.actions; -import org.jetbrains.annotations.ApiStatus; - -@ApiStatus.Internal -public final class ExpandToLevel3Action extends BaseExpandToLevelAction { - public ExpandToLevel3Action() { +final class ExpandToLevel3Action extends BaseExpandToLevelAction { + ExpandToLevel3Action() { super(3, false); } } diff --git a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandToLevel4Action.java b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandToLevel4Action.java index e9328714277a..4d87b49f4b1b 100644 --- a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandToLevel4Action.java +++ b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandToLevel4Action.java @@ -1,11 +1,8 @@ -// 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.codeInsight.folding.impl.actions; -import org.jetbrains.annotations.ApiStatus; - -@ApiStatus.Internal -public final class ExpandToLevel4Action extends BaseExpandToLevelAction { - public ExpandToLevel4Action() { +final class ExpandToLevel4Action extends BaseExpandToLevelAction { + ExpandToLevel4Action() { super(4, false); } } diff --git a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandToLevel5Action.java b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandToLevel5Action.java index 789595f1d265..409ddc124b39 100644 --- a/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandToLevel5Action.java +++ b/platform/foldings/src/com/intellij/codeInsight/folding/impl/actions/ExpandToLevel5Action.java @@ -1,11 +1,8 @@ -// 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.codeInsight.folding.impl.actions; -import org.jetbrains.annotations.ApiStatus; - -@ApiStatus.Internal -public final class ExpandToLevel5Action extends BaseExpandToLevelAction { - public ExpandToLevel5Action() { +final class ExpandToLevel5Action extends BaseExpandToLevelAction { + ExpandToLevel5Action() { super(5, false); } } diff --git a/platform/lang-impl/api-dump-unreviewed.txt b/platform/lang-impl/api-dump-unreviewed.txt index 060b12383941..64689cc364fc 100644 --- a/platform/lang-impl/api-dump-unreviewed.txt +++ b/platform/lang-impl/api-dump-unreviewed.txt @@ -3267,10 +3267,6 @@ f:com.intellij.codeInsight.generation.OverrideMethodsHandler - ():V - invoke(com.intellij.openapi.project.Project,com.intellij.openapi.editor.Editor,com.intellij.psi.PsiFile):V - startInWriteAction():Z -f:com.intellij.codeInsight.generation.actions.AutoIndentLinesAction -- com.intellij.codeInsight.actions.BaseCodeInsightAction -- com.intellij.openapi.project.DumbAware -- ():V c:com.intellij.codeInsight.generation.actions.CommentByLineCommentAction - com.intellij.codeInsight.actions.MultiCaretCodeInsightAction - com.intellij.ide.lightEdit.LightEditCompatible diff --git a/platform/lang-impl/src/com/intellij/codeInsight/generation/actions/AutoIndentLinesAction.java b/platform/lang-impl/src/com/intellij/codeInsight/generation/actions/AutoIndentLinesAction.java index 75718bfcdb8e..b12035bb6893 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/generation/actions/AutoIndentLinesAction.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/generation/actions/AutoIndentLinesAction.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; @@ -17,9 +16,11 @@ import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiFile; import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil; import com.intellij.util.DocumentUtil; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +@ApiStatus.Internal public final class AutoIndentLinesAction extends BaseCodeInsightAction implements DumbAware { @Override protected @Nullable Editor getEditor(@NotNull DataContext dataContext, @NotNull Project project, boolean forUpdate) { diff --git a/platform/lang-impl/src/com/intellij/ide/actions/GoToLinkTargetAction.java b/platform/lang-impl/src/com/intellij/ide/actions/GoToLinkTargetAction.java index d382d3675dc7..ad6984646f0c 100644 --- a/platform/lang-impl/src/com/intellij/ide/actions/GoToLinkTargetAction.java +++ b/platform/lang-impl/src/com/intellij/ide/actions/GoToLinkTargetAction.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.ide.actions; import com.intellij.ide.projectView.ProjectView; @@ -12,12 +12,10 @@ import com.intellij.openapi.vfs.VFileProperty; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiFileSystemItem; import com.intellij.psi.util.PsiUtilCore; -import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -@ApiStatus.Internal -public final class GoToLinkTargetAction extends DumbAwareAction { +final class GoToLinkTargetAction extends DumbAwareAction { private static final Logger LOG = Logger.getInstance(GoToLinkTargetAction.class); @Override diff --git a/platform/lang-impl/src/com/intellij/internal/DumpRunConfigurationTypesAction.kt b/platform/lang-impl/src/com/intellij/internal/DumpRunConfigurationTypesAction.kt index c21bd65cd3d8..03baa8b313cb 100644 --- a/platform/lang-impl/src/com/intellij/internal/DumpRunConfigurationTypesAction.kt +++ b/platform/lang-impl/src/com/intellij/internal/DumpRunConfigurationTypesAction.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.internal import com.intellij.execution.EnvFilesOptions @@ -28,8 +28,7 @@ import com.intellij.util.containers.mapSmartSet private const val UNSPECIFIED = "---" -internal class DumpRunConfigurationTypesAction : DumbAwareAction() { - +private class DumpRunConfigurationTypesAction : DumbAwareAction() { override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.BGT override fun update(e: AnActionEvent) { diff --git a/platform/platform-api/api-dump-unreviewed.txt b/platform/platform-api/api-dump-unreviewed.txt index 738c9d99e9d2..961281a295fe 100644 --- a/platform/platform-api/api-dump-unreviewed.txt +++ b/platform/platform-api/api-dump-unreviewed.txt @@ -748,12 +748,6 @@ com.intellij.ide.actions.exclusion.ExclusionHandler - a:isNodeExcluded(java.lang.Object):Z - a:isNodeExclusionAvailable(java.lang.Object):Z - a:onDone(Z):V -f:com.intellij.ide.actions.exclusion.IncludeTreeNodeAction -- com.intellij.openapi.actionSystem.AnAction -- ():V -- actionPerformed(com.intellij.openapi.actionSystem.AnActionEvent):V -- getActionUpdateThread():com.intellij.openapi.actionSystem.ActionUpdateThread -- update(com.intellij.openapi.actionSystem.AnActionEvent):V e:com.intellij.ide.browsers.BrowserFamily - java.lang.Enum - com.intellij.openapi.util.Iconable diff --git a/platform/platform-api/src/com/intellij/ide/actions/exclusion/IncludeTreeNodeAction.java b/platform/platform-api/src/com/intellij/ide/actions/exclusion/IncludeTreeNodeAction.java index b4ae5b67a1a5..de629dd0c11a 100644 --- a/platform/platform-api/src/com/intellij/ide/actions/exclusion/IncludeTreeNodeAction.java +++ b/platform/platform-api/src/com/intellij/ide/actions/exclusion/IncludeTreeNodeAction.java @@ -1,25 +1,8 @@ -/* - * Copyright 2000-2016 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.ide.actions.exclusion; -/** - * @author Dmitry Batkovich - */ -public final class IncludeTreeNodeAction extends TreeNodeExclusionAction { - public IncludeTreeNodeAction() { +final class IncludeTreeNodeAction extends TreeNodeExclusionAction { + IncludeTreeNodeAction() { super(false); } } diff --git a/platform/platform-impl/src/com/intellij/codeInsight/folding/impl/FoldingUtil.java b/platform/platform-impl/src/com/intellij/codeInsight/folding/impl/FoldingUtil.java index ff230b2005ac..86eb8291f411 100644 --- a/platform/platform-impl/src/com/intellij/codeInsight/folding/impl/FoldingUtil.java +++ b/platform/platform-impl/src/com/intellij/codeInsight/folding/impl/FoldingUtil.java @@ -1,5 +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.codeInsight.folding.impl; import com.intellij.openapi.editor.Editor; @@ -14,14 +13,14 @@ import org.jetbrains.annotations.Nullable; import java.util.*; public final class FoldingUtil { - private FoldingUtil() {} + private FoldingUtil() { } public static @Nullable FoldRegion findFoldRegion(@NotNull Editor editor, int startOffset, int endOffset) { FoldRegion region = editor.getFoldingModel().getFoldRegion(startOffset, endOffset); return region != null && region.isValid() ? region : null; } - public static @Nullable FoldRegion findFoldRegionStartingAtLine(@NotNull Editor editor, int line){ + public static @Nullable FoldRegion findFoldRegionStartingAtLine(@NotNull Editor editor, int line) { if (line < 0 || line >= editor.getDocument().getLineCount()) { return null; } @@ -39,7 +38,7 @@ public final class FoldingUtil { return result; } - public static FoldRegion[] getFoldRegionsAtOffset(Editor editor, int offset){ + public static FoldRegion[] getFoldRegionsAtOffset(Editor editor, int offset) { List list = new ArrayList<>(); FoldRegion[] allRegions = editor.getFoldingModel().getAllFoldRegions(); for (FoldRegion region : allRegions) { @@ -59,12 +58,11 @@ public final class FoldingUtil { } public static boolean isHighlighterFolded(@NotNull Editor editor, @NotNull RangeHighlighter highlighter) { - int startOffset = highlighter instanceof RangeHighlighterEx ? - ((RangeHighlighterEx)highlighter).getAffectedAreaStartOffset() : - highlighter.getStartOffset(); - int endOffset = highlighter instanceof RangeHighlighterEx ? - ((RangeHighlighterEx)highlighter).getAffectedAreaEndOffset() : - highlighter.getEndOffset(); + int startOffset = highlighter instanceof RangeHighlighterEx + ? ((RangeHighlighterEx)highlighter).getAffectedAreaStartOffset() + : highlighter.getStartOffset(); + int endOffset = + highlighter instanceof RangeHighlighterEx ? ((RangeHighlighterEx)highlighter).getAffectedAreaEndOffset() : highlighter.getEndOffset(); return isTextRangeFolded(editor, new TextRange(startOffset, endOffset)); } @@ -74,7 +72,7 @@ public final class FoldingUtil { } /** - * Iterates fold regions tree in a depth-first order (pre-order) + * Iterates fold region tree in a depth-first order (pre-order) */ public static Iterator createFoldTreeIterator(@NotNull Editor editor) { final FoldRegion[] allRegions = editor.getFoldingModel().getAllFoldRegions(); @@ -119,6 +117,4 @@ public final class FoldingUtil { } }; } - - } diff --git a/platform/platform-impl/src/com/intellij/xml/breadcrumbs/BreadcrumbsPanel.java b/platform/platform-impl/src/com/intellij/xml/breadcrumbs/BreadcrumbsPanel.java index 9da71fc3c5ac..29e8f2744829 100644 --- a/platform/platform-impl/src/com/intellij/xml/breadcrumbs/BreadcrumbsPanel.java +++ b/platform/platform-impl/src/com/intellij/xml/breadcrumbs/BreadcrumbsPanel.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.breadcrumbs; import com.intellij.codeInsight.highlighting.HighlightManager; @@ -28,9 +28,7 @@ import com.intellij.openapi.util.TextRange; import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.vcs.FileStatusListener; import com.intellij.openapi.vcs.FileStatusManager; -import com.intellij.ui.DirtyUI; -import com.intellij.ui.ExperimentalUI; -import com.intellij.ui.Gray; +import com.intellij.ui.*; import com.intellij.ui.breadcrumbs.BreadcrumbsProvider; import com.intellij.ui.components.breadcrumbs.Breadcrumbs; import com.intellij.ui.components.breadcrumbs.Crumb; @@ -53,12 +51,8 @@ import java.util.Collection; import java.util.Collections; import java.util.List; -import static com.intellij.openapi.diagnostic.Logger.getInstance; -import static com.intellij.ui.RelativeFont.SMALL; -import static com.intellij.ui.ScrollPaneFactory.createScrollPane; - public abstract class BreadcrumbsPanel extends JComponent implements Disposable { - private static final Logger LOG = getInstance(BreadcrumbsPanel.class); + private static final Logger LOG = Logger.getInstance(BreadcrumbsPanel.class); final PsiBreadcrumbs breadcrumbs = new PsiBreadcrumbs(); @@ -108,7 +102,7 @@ public abstract class BreadcrumbsPanel extends JComponent implements Disposable breadcrumbs.onSelect(this::itemSelected); breadcrumbs.setFont(getNewFont(myEditor)); - JScrollPane pane = createScrollPane(breadcrumbs, true); + JScrollPane pane = ScrollPaneFactory.createScrollPane(breadcrumbs, true); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); pane.getHorizontalScrollBar().setEnabled(false); setLayout(new BorderLayout()); @@ -332,7 +326,7 @@ public abstract class BreadcrumbsPanel extends JComponent implements Disposable private static Font getNewFont(Editor editor) { Font font = editor == null || Registry.is("editor.breadcrumbs.system.font") ? StartupUiUtil.getLabelFont() : getEditorFont(editor); - return UISettings.getInstance().getUseSmallLabelsOnTabs() && !ExperimentalUI.isNewUI() ? SMALL.derive(font) : font; + return UISettings.getInstance().getUseSmallLabelsOnTabs() && !ExperimentalUI.isNewUI() ? RelativeFont.SMALL.derive(font) : font; } private static Font getEditorFont(Editor editor) { diff --git a/platform/testFramework/src/com/intellij/facet/mock/AnotherFacetConfigProperties.java b/platform/testFramework/src/com/intellij/facet/mock/AnotherFacetConfigProperties.java index e6e31bc7c7c1..a11a3a6fa99f 100644 --- a/platform/testFramework/src/com/intellij/facet/mock/AnotherFacetConfigProperties.java +++ b/platform/testFramework/src/com/intellij/facet/mock/AnotherFacetConfigProperties.java @@ -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 com.intellij.facet.mock; import com.intellij.util.xmlb.annotations.XCollection; @@ -7,7 +7,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; -public class AnotherFacetConfigProperties { +public final class AnotherFacetConfigProperties { @XCollection(propertyElementName = "firstElement", elementName = "field", valueAttributeName = "") public List firstElement = Arrays.asList("gradle"); diff --git a/platform/testFramework/src/com/intellij/facet/mock/AnotherMockFacetType.java b/platform/testFramework/src/com/intellij/facet/mock/AnotherMockFacetType.java index 48ea7782161b..af5861c3955d 100644 --- a/platform/testFramework/src/com/intellij/facet/mock/AnotherMockFacetType.java +++ b/platform/testFramework/src/com/intellij/facet/mock/AnotherMockFacetType.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 AnotherMockFacetType extends FacetType { +public final class AnotherMockFacetType extends FacetType { public static final FacetTypeId ID = new FacetTypeId<>("another_mock"); public AnotherMockFacetType() { diff --git a/platform/testFramework/src/com/intellij/ui/ConflictInterceptor.java b/platform/testFramework/src/com/intellij/ui/ConflictInterceptor.java index f213fbb50287..279d52bf4a80 100644 --- a/platform/testFramework/src/com/intellij/ui/ConflictInterceptor.java +++ b/platform/testFramework/src/com/intellij/ui/ConflictInterceptor.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.ui; import com.intellij.refactoring.ui.ConflictsDialog; @@ -11,7 +11,7 @@ import static org.junit.Assert.assertEquals; /** * An interceptor that expects a conflict dialog. An interceptor assumes that "Continue" button will be pressed */ -public class ConflictInterceptor extends UiInterceptors.UiInterceptor { +public final class ConflictInterceptor extends UiInterceptors.UiInterceptor { private final List myConflicts; /** diff --git a/plugins/gradle/java/src/config/GradleImplicitUsageProvider.kt b/plugins/gradle/java/src/config/GradleImplicitUsageProvider.kt index 4897f97b68e7..d97a34fbfd3f 100644 --- a/plugins/gradle/java/src/config/GradleImplicitUsageProvider.kt +++ b/plugins/gradle/java/src/config/GradleImplicitUsageProvider.kt @@ -1,4 +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 org.jetbrains.plugins.gradle.config import com.intellij.codeInsight.daemon.ImplicitUsageProvider @@ -14,24 +14,19 @@ import com.intellij.util.Processor import org.jetbrains.plugins.gradle.service.resolve.GradleCommonClassNames.GRADLE_API_TASKS_ACTION import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrField -/** - * @author Vladislav.Soroka - */ -class GradleImplicitUsageProvider : ImplicitUsageProvider { - companion object { - val taskAnnotations = listOf("org.gradle.api.tasks.Input", - "org.gradle.api.tasks.InputFile", - "org.gradle.api.tasks.InputFiles", - "org.gradle.api.tasks.InputDirectory", - "org.gradle.api.tasks.OutputDirectory", - "org.gradle.api.tasks.OutputDirectories", - "org.gradle.api.tasks.OutputFile", - "org.gradle.api.tasks.LocalState", - "org.gradle.api.tasks.Destroys", - "org.gradle.api.tasks.Classpath", - "org.gradle.api.tasks.Console") - } +private val taskAnnotations = listOf("org.gradle.api.tasks.Input", + "org.gradle.api.tasks.InputFile", + "org.gradle.api.tasks.InputFiles", + "org.gradle.api.tasks.InputDirectory", + "org.gradle.api.tasks.OutputDirectory", + "org.gradle.api.tasks.OutputDirectories", + "org.gradle.api.tasks.OutputFile", + "org.gradle.api.tasks.LocalState", + "org.gradle.api.tasks.Destroys", + "org.gradle.api.tasks.Classpath", + "org.gradle.api.tasks.Console") +private class GradleImplicitUsageProvider : ImplicitUsageProvider { override fun isImplicitUsage(element: PsiElement): Boolean { var modifierList: PsiModifierList? = null if (element is GrField) { diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/slicer/GroovySliceProvider.kt b/plugins/groovy/src/org/jetbrains/plugins/groovy/slicer/GroovySliceProvider.kt index b5deeef1df87..dd7d5ee5580f 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/slicer/GroovySliceProvider.kt +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/slicer/GroovySliceProvider.kt @@ -1,4 +1,4 @@ -// 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.jetbrains.plugins.groovy.slicer import com.intellij.ide.util.treeView.AbstractTreeStructure @@ -14,7 +14,7 @@ import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpres import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.literals.GrLiteral import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrMethod -class GroovySliceProvider : SliceLanguageSupportProvider, SliceUsageTransformer { +internal class GroovySliceProvider : SliceLanguageSupportProvider, SliceUsageTransformer { object GroovySliceLeafEquality : SliceLeafEquality() { override fun substituteElement(element: PsiElement): PsiElement = element.getGroovyReferenceTargetOrThis() } diff --git a/plugins/htmltools/src/com/intellij/htmltools/xml/util/HtmlUpdateImageSizeIntention.java b/plugins/htmltools/src/com/intellij/htmltools/xml/util/HtmlUpdateImageSizeIntention.java index f4e5be945f20..25a092275053 100644 --- a/plugins/htmltools/src/com/intellij/htmltools/xml/util/HtmlUpdateImageSizeIntention.java +++ b/plugins/htmltools/src/com/intellij/htmltools/xml/util/HtmlUpdateImageSizeIntention.java @@ -3,7 +3,6 @@ package com.intellij.htmltools.xml.util; import com.intellij.codeInsight.intention.impl.BaseIntentionAction; import com.intellij.htmltools.HtmlToolsBundle; import com.intellij.lang.html.HTMLLanguage; -import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiFile; diff --git a/plugins/ide-features-trainer/src/training/featuresSuggester/suggesters/FileStructureSuggester.kt b/plugins/ide-features-trainer/src/training/featuresSuggester/suggesters/FileStructureSuggester.kt index 4b5c1a4c66e4..f66b5df1e23b 100644 --- a/plugins/ide-features-trainer/src/training/featuresSuggester/suggesters/FileStructureSuggester.kt +++ b/plugins/ide-features-trainer/src/training/featuresSuggester/suggesters/FileStructureSuggester.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 training.featuresSuggester.suggesters import com.intellij.find.FindManager @@ -14,7 +15,7 @@ import training.featuresSuggester.actions.Action import training.featuresSuggester.actions.EditorFindAction import training.featuresSuggester.actions.EditorFocusGainedAction -class FileStructureSuggester : AbstractFeatureSuggester() { +private class FileStructureSuggester : AbstractFeatureSuggester() { override val id: String = "File structure" override val suggestingActionDisplayName: String = FeatureSuggesterBundle.message("file.structure.name") diff --git a/plugins/markdown/xml/src/main/kotlin/org/intellij/plugins/markdown/xml/DefaultMarkdownFileViewProvider.kt b/plugins/markdown/xml/src/main/kotlin/org/intellij/plugins/markdown/xml/DefaultMarkdownFileViewProvider.kt index a5073518b32d..e179487a459f 100644 --- a/plugins/markdown/xml/src/main/kotlin/org/intellij/plugins/markdown/xml/DefaultMarkdownFileViewProvider.kt +++ b/plugins/markdown/xml/src/main/kotlin/org/intellij/plugins/markdown/xml/DefaultMarkdownFileViewProvider.kt @@ -14,10 +14,8 @@ import org.intellij.plugins.markdown.lang.MarkdownElementTypes.MARKDOWN_TEMPLATE import org.intellij.plugins.markdown.lang.MarkdownLanguage import org.intellij.plugins.markdown.lang.isMarkdownLanguage import org.intellij.plugins.markdown.lang.parser.createMarkdownFile -import org.jetbrains.annotations.ApiStatus -@ApiStatus.Internal -class DefaultMarkdownFileViewProvider( +internal class DefaultMarkdownFileViewProvider( manager: PsiManager, file: VirtualFile, eventSystemEnabled: Boolean diff --git a/spellchecker/src/com/intellij/spellchecker/quickfixes/DictionarySuggestionProvider.java b/spellchecker/src/com/intellij/spellchecker/quickfixes/DictionarySuggestionProvider.java index ab6eba233d89..2c80159349b8 100644 --- a/spellchecker/src/com/intellij/spellchecker/quickfixes/DictionarySuggestionProvider.java +++ b/spellchecker/src/com/intellij/spellchecker/quickfixes/DictionarySuggestionProvider.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 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.spellchecker.quickfixes; import com.intellij.openapi.project.Project; @@ -30,9 +16,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Set; - -public class DictionarySuggestionProvider extends PreferrableNameSuggestionProvider { - +final class DictionarySuggestionProvider extends PreferrableNameSuggestionProvider { private boolean active; public void setActive(boolean active) { diff --git a/xml/dom-impl/src/com/intellij/util/xml/DomNameSuggestionProvider.java b/xml/dom-impl/src/com/intellij/util/xml/DomNameSuggestionProvider.java index 3341afab0c79..7a762912241f 100644 --- a/xml/dom-impl/src/com/intellij/util/xml/DomNameSuggestionProvider.java +++ b/xml/dom-impl/src/com/intellij/util/xml/DomNameSuggestionProvider.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.util.xml; import com.intellij.psi.PsiElement; @@ -11,10 +11,7 @@ import org.jetbrains.annotations.Nullable; import java.util.Set; -/** - * @author Gregory.Shrago - */ -public class DomNameSuggestionProvider implements NameSuggestionProvider { +final class DomNameSuggestionProvider implements NameSuggestionProvider { @Override public SuggestedNameInfo getSuggestedNames(final PsiElement element, final PsiElement nameSuggestionContext, final Set result) { if (element instanceof PsiMetaOwner) { diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/DefaultDomTargetDescriptionProvider.java b/xml/dom-impl/src/com/intellij/util/xml/impl/DefaultDomTargetDescriptionProvider.java index 0c2089f90446..2cbf0f9d2b92 100644 --- a/xml/dom-impl/src/com/intellij/util/xml/impl/DefaultDomTargetDescriptionProvider.java +++ b/xml/dom-impl/src/com/intellij/util/xml/impl/DefaultDomTargetDescriptionProvider.java @@ -1,32 +1,21 @@ -/* - * Copyright 2000-2014 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.util.xml.impl; +import com.intellij.codeInsight.highlighting.HighlightUsagesDescriptionLocation; import com.intellij.openapi.util.text.StringUtil; import com.intellij.pom.PomDescriptionProvider; import com.intellij.pom.PomTarget; import com.intellij.psi.ElementDescriptionLocation; +import com.intellij.usageView.UsageViewLongNameLocation; import com.intellij.usageView.UsageViewNodeTextLocation; import com.intellij.usageView.UsageViewTypeLocation; -import com.intellij.usageView.UsageViewLongNameLocation; -import com.intellij.util.xml.*; -import com.intellij.codeInsight.highlighting.HighlightUsagesDescriptionLocation; +import com.intellij.util.xml.DomElement; +import com.intellij.util.xml.DomTarget; +import com.intellij.util.xml.ElementPresentation; +import com.intellij.util.xml.ElementPresentationTemplate; import org.jetbrains.annotations.NotNull; -public class DefaultDomTargetDescriptionProvider extends PomDescriptionProvider { +final class DefaultDomTargetDescriptionProvider extends PomDescriptionProvider { @Override public String getElementDescription(@NotNull PomTarget element, @NotNull ElementDescriptionLocation location) { if (!(element instanceof DomTarget target)) return null; diff --git a/xml/dom-impl/src/com/intellij/util/xml/structure/DomStructureViewBuilderProvider.java b/xml/dom-impl/src/com/intellij/util/xml/structure/DomStructureViewBuilderProvider.java index bfa932702743..7354176b2d91 100644 --- a/xml/dom-impl/src/com/intellij/util/xml/structure/DomStructureViewBuilderProvider.java +++ b/xml/dom-impl/src/com/intellij/util/xml/structure/DomStructureViewBuilderProvider.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2012 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.util.xml.structure; import com.intellij.ide.structureView.StructureViewBuilder; @@ -25,12 +11,9 @@ import com.intellij.util.xml.DomService; import org.jetbrains.annotations.NotNull; /** - * This SHOULD NOT be subclassed! - * * @author Dmitry Avdeev */ public final class DomStructureViewBuilderProvider implements XmlStructureViewBuilderProvider { - @Override public StructureViewBuilder createStructureViewBuilder(@NotNull XmlFile file) { if (DomManager.getDomManager(file.getProject()).getDomFileDescription(file) != null) { @@ -39,6 +22,5 @@ public final class DomStructureViewBuilderProvider implements XmlStructureViewBu return null; } - public static final Function DESCRIPTOR = - element -> DomService.StructureViewMode.SHOW; + public static final Function DESCRIPTOR = element -> DomService.StructureViewMode.SHOW; } diff --git a/xml/impl/src/com/intellij/codeInsight/template/emmet/EmmetPreviewAction.java b/xml/impl/src/com/intellij/codeInsight/template/emmet/EmmetPreviewAction.java index d9aad39d26b8..4625eacfd008 100644 --- a/xml/impl/src/com/intellij/codeInsight/template/emmet/EmmetPreviewAction.java +++ b/xml/impl/src/com/intellij/codeInsight/template/emmet/EmmetPreviewAction.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.codeInsight.template.emmet; import com.intellij.codeInsight.CodeInsightActionHandler; @@ -20,7 +20,7 @@ import com.intellij.util.concurrency.AppExecutorUtil; import com.intellij.xml.XmlBundle; import org.jetbrains.annotations.NotNull; -public class EmmetPreviewAction extends BaseCodeInsightAction implements DumbAware, PopupAction { +final class EmmetPreviewAction extends BaseCodeInsightAction implements DumbAware, PopupAction { @Override protected @NotNull CodeInsightActionHandler getHandler() { return new CodeInsightActionHandler() { diff --git a/xml/xml-psi-impl/src/com/intellij/html/embedding/HtmlAttributeEmbeddedContentProvider.kt b/xml/xml-psi-impl/src/com/intellij/html/embedding/HtmlAttributeEmbeddedContentProvider.kt index 6b9301242191..e1961cc728eb 100644 --- a/xml/xml-psi-impl/src/com/intellij/html/embedding/HtmlAttributeEmbeddedContentProvider.kt +++ b/xml/xml-psi-impl/src/com/intellij/html/embedding/HtmlAttributeEmbeddedContentProvider.kt @@ -1,4 +1,4 @@ -// 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 com.intellij.html.embedding import com.intellij.lexer.BaseHtmlLexer @@ -101,13 +101,16 @@ abstract class HtmlAttributeEmbeddedContentProvider(lexer: BaseHtmlLexer) override fun hasState(): Boolean = myTagNameRead || myWithinTag || myTagName != null || myAttributeName != null || embedment - override fun getState(): Any? = - if (hasState()) - AttributeState(myTagNameRead, myWithinTag, myTagName, myAttributeName, embedment) - else - null + override fun getState(): Any? { + return if (hasState()) AttributeState(myTagNameRead, myWithinTag, myTagName, myAttributeName, embedment) else null + } - open class AttributeState(val tagNameRead: Boolean, val withinTag: Boolean, val tagName: CharSequence?, - val attributeName: CharSequence?, embedment: Boolean) : BaseState(embedment) + open class AttributeState( + val tagNameRead: Boolean, + val withinTag: Boolean, + val tagName: CharSequence?, + val attributeName: CharSequence?, + embedment: Boolean, + ) : BaseState(embedment) } \ No newline at end of file