From ac17c982916d4c92a1b13c62a88af01cb9cd7877 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Tue, 18 Feb 2025 16:09:30 +0100 Subject: [PATCH] fix ClasspathElementChooser visibility GitOrigin-RevId: 6cc1267abe84565a238f1023b5e0b76ad2cae066 --- .../commandLine/CommandLineFileType.java | 4 +++- .../classpath/ClasspathElementChooser.java | 20 ++++--------------- .../classpath/CreateModuleLibraryChooser.java | 4 ++-- .../impl/JavaServiceLineMarkerUtil.java | 4 ++-- ...PyExtractSuperclassInitializationInfo.java | 8 ++++---- .../vp/MembersBasedPresenterImpl.java | 6 ++++-- .../PyPullUpViewInitializationInfo.java | 8 ++++---- 7 files changed, 23 insertions(+), 31 deletions(-) diff --git a/commandInterface/src/com/intellij/commandInterface/commandLine/CommandLineFileType.java b/commandInterface/src/com/intellij/commandInterface/commandLine/CommandLineFileType.java index 1a99544da294..1ff5df120347 100644 --- a/commandInterface/src/com/intellij/commandInterface/commandLine/CommandLineFileType.java +++ b/commandInterface/src/com/intellij/commandInterface/commandLine/CommandLineFileType.java @@ -2,6 +2,7 @@ package com.intellij.commandInterface.commandLine; import com.intellij.openapi.fileTypes.LanguageFileType; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import javax.swing.*; @@ -15,7 +16,8 @@ public final class CommandLineFileType extends LanguageFileType { /** * Command line extension */ - static final String EXTENSION = "cmdline"; + @ApiStatus.Internal + public static final String EXTENSION = "cmdline"; private CommandLineFileType() { super(CommandLineLanguage.INSTANCE); diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/classpath/ClasspathElementChooser.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/classpath/ClasspathElementChooser.java index a8331b85c8f7..31a70649c731 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/classpath/ClasspathElementChooser.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/classpath/ClasspathElementChooser.java @@ -1,26 +1,14 @@ -/* - * Copyright 2000-2010 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.openapi.roots.ui.configuration.classpath; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Unmodifiable; import java.util.List; -interface ClasspathElementChooser { +@ApiStatus.Internal +public interface ClasspathElementChooser { @NotNull @Unmodifiable List chooseElements(); diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/classpath/CreateModuleLibraryChooser.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/classpath/CreateModuleLibraryChooser.java index ca711fc32d08..569fd7230e55 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/classpath/CreateModuleLibraryChooser.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/classpath/CreateModuleLibraryChooser.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.openapi.roots.ui.configuration.classpath; import com.intellij.openapi.actionSystem.LangDataKeys; @@ -31,7 +31,7 @@ import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Collectors; -public class CreateModuleLibraryChooser implements ClasspathElementChooser { +public final class CreateModuleLibraryChooser implements ClasspathElementChooser { private final JComponent myParentComponent; private final Module myModule; private final LibraryTable.ModifiableModel myModuleLibrariesModel; diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/JavaServiceLineMarkerUtil.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/JavaServiceLineMarkerUtil.java index 5bbbbead20f8..a8b5423e959c 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/JavaServiceLineMarkerUtil.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/JavaServiceLineMarkerUtil.java @@ -160,7 +160,7 @@ final class JavaServiceLineMarkerUtil { } } - private static class ServiceUsesNavigationHandler extends ServiceNavigationHandler { + private static final class ServiceUsesNavigationHandler extends ServiceNavigationHandler { ServiceUsesNavigationHandler(String interfaceClassName) { super(interfaceClassName); } @@ -174,7 +174,7 @@ final class JavaServiceLineMarkerUtil { } } - private static class ServiceProvidesNavigationHandler extends ServiceNavigationHandler { + private static final class ServiceProvidesNavigationHandler extends ServiceNavigationHandler { private final String myImplementerClassName; ServiceProvidesNavigationHandler(@NotNull String interfaceClassName, @NotNull String implementerClassName) { diff --git a/python/src/com/jetbrains/python/refactoring/classes/extractSuperclass/PyExtractSuperclassInitializationInfo.java b/python/src/com/jetbrains/python/refactoring/classes/extractSuperclass/PyExtractSuperclassInitializationInfo.java index 040ba24d9fc5..d28076f78953 100644 --- a/python/src/com/jetbrains/python/refactoring/classes/extractSuperclass/PyExtractSuperclassInitializationInfo.java +++ b/python/src/com/jetbrains/python/refactoring/classes/extractSuperclass/PyExtractSuperclassInitializationInfo.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.jetbrains.python.refactoring.classes.extractSuperclass; import com.intellij.openapi.util.NlsSafe; @@ -7,16 +7,16 @@ import com.intellij.refactoring.classMembers.MemberInfoModel; import com.jetbrains.python.psi.PyElement; import com.jetbrains.python.refactoring.classes.membersManager.PyMemberInfo; import com.jetbrains.python.refactoring.classes.membersManager.vp.MembersViewInitializationInfo; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import java.util.Collection; /** * View configuration for "extract superclass" - * - * @author Ilya.Kazakevich */ -class PyExtractSuperclassInitializationInfo extends MembersViewInitializationInfo { +@ApiStatus.Internal +public final class PyExtractSuperclassInitializationInfo extends MembersViewInitializationInfo { private final @NotNull String myDefaultFilePath; private final VirtualFile @NotNull [] myRoots; diff --git a/python/src/com/jetbrains/python/refactoring/classes/membersManager/vp/MembersBasedPresenterImpl.java b/python/src/com/jetbrains/python/refactoring/classes/membersManager/vp/MembersBasedPresenterImpl.java index e4d6312eab48..ee4b1c8662ac 100644 --- a/python/src/com/jetbrains/python/refactoring/classes/membersManager/vp/MembersBasedPresenterImpl.java +++ b/python/src/com/jetbrains/python/refactoring/classes/membersManager/vp/MembersBasedPresenterImpl.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.jetbrains.python.refactoring.classes.membersManager.vp; import com.intellij.refactoring.RefactoringBundle; @@ -8,6 +8,7 @@ import com.jetbrains.python.psi.PyClass; import com.jetbrains.python.psi.PyElement; import com.jetbrains.python.refactoring.classes.PyMemberInfoStorage; import com.jetbrains.python.refactoring.classes.membersManager.PyMemberInfo; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; @@ -23,7 +24,8 @@ import java.util.Collection; * @param Type of model {@link #myModel} * @author Ilya.Kazakevich */ -abstract class MembersBasedPresenterImpl, +@ApiStatus.Internal +public abstract class MembersBasedPresenterImpl, M extends MemberInfoModel>> implements MembersBasedPresenter { protected final @NotNull T myView; protected final @NotNull PyClass myClassUnderRefactoring; diff --git a/python/src/com/jetbrains/python/refactoring/classes/pullUp/PyPullUpViewInitializationInfo.java b/python/src/com/jetbrains/python/refactoring/classes/pullUp/PyPullUpViewInitializationInfo.java index 56a70e2c592a..516b20ea033a 100644 --- a/python/src/com/jetbrains/python/refactoring/classes/pullUp/PyPullUpViewInitializationInfo.java +++ b/python/src/com/jetbrains/python/refactoring/classes/pullUp/PyPullUpViewInitializationInfo.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.jetbrains.python.refactoring.classes.pullUp; import com.intellij.refactoring.classMembers.MemberInfoModel; @@ -6,6 +6,7 @@ import com.jetbrains.python.psi.PyClass; import com.jetbrains.python.psi.PyElement; import com.jetbrains.python.refactoring.classes.membersManager.PyMemberInfo; import com.jetbrains.python.refactoring.classes.membersManager.vp.MembersViewInitializationInfo; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; @@ -15,10 +16,9 @@ import java.util.List; /** * Configuration for pull-up view - * - * @author Ilya.Kazakevich */ -class PyPullUpViewInitializationInfo extends MembersViewInitializationInfo { +@ApiStatus.Internal +public final class PyPullUpViewInitializationInfo extends MembersViewInitializationInfo { private final @NotNull Collection myParents; /**