fix method visibility (part 4)

GitOrigin-RevId: 8ee369d4873cce55d87cf1a80e96373622e2d1af
This commit is contained in:
Vladimir Krivosheev
2025-02-24 21:28:25 +00:00
committed by intellij-monorepo-bot
parent e06842e2a5
commit edccfc3e44
18 changed files with 65 additions and 54 deletions
@@ -21,7 +21,7 @@ public class RangeMarkerWindow implements RangeMarkerEx {
private final int myStartShift;
private final int myEndShift;
RangeMarkerWindow(@NotNull DocumentWindow documentWindow, int startOffset, int endOffset, boolean surviveOnExternalChange) {
public RangeMarkerWindow(@NotNull DocumentWindow documentWindow, int startOffset, int endOffset, boolean surviveOnExternalChange) {
myDocumentWindow = documentWindow;
TextRange hostRange = documentWindow.injectedToHost(new ProperTextRange(startOffset, endOffset));
// shifts to be added to hostToInjected(hostMarker) offsets to get the target marker offsets, when the startOffset/endOffset lie inside prefix/suffix
@@ -34,8 +34,8 @@ public class RangeMarkerWindow implements RangeMarkerEx {
}
}
@NotNull
RangeMarker createHostRangeMarkerToTrack(@NotNull TextRange hostRange, boolean surviveOnExternalChange) {
@ApiStatus.Internal
public @NotNull RangeMarker createHostRangeMarkerToTrack(@NotNull TextRange hostRange, boolean surviveOnExternalChange) {
return myDocumentWindow.getDelegate().createRangeMarker(hostRange.getStartOffset(), hostRange.getEndOffset(), surviveOnExternalChange);
}
@@ -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.psi.impl;
import com.intellij.lang.ASTNode;
@@ -72,7 +72,8 @@ public final class ChangedPsiRangeUtil {
return new TextRange(commonPrefixLength, psiLength - commonSuffixLength);
}
static @Nullable ProperTextRange getChangedPsiRange(@NotNull PsiFile file,
@ApiStatus.Internal
public static @Nullable ProperTextRange getChangedPsiRange(@NotNull PsiFile file,
@NotNull Document document,
@NotNull CharSequence oldDocumentText,
@NotNull CharSequence newDocumentText) {
@@ -391,12 +391,14 @@ public abstract class PsiDocumentManagerBase extends PsiDocumentManager implemen
}
}
boolean isEventSystemEnabled(@NotNull Document document) {
@ApiStatus.Internal
public boolean isEventSystemEnabled(@NotNull Document document) {
List<FileViewProvider> viewProviders = getCachedViewProviders(document);
return FileViewProviderUtil.isEventSystemEnabled(viewProviders);
}
boolean finishCommit(@NotNull Document document,
@ApiStatus.Internal
public boolean finishCommit(@NotNull Document document,
@NotNull List<? extends BooleanRunnable> finishProcessors,
@NotNull List<? extends BooleanRunnable> reparseInjectedProcessors,
boolean synchronously,
@@ -502,7 +504,8 @@ public abstract class PsiDocumentManagerBase extends PsiDocumentManager implemen
return true;
}
void forceReload(@Nullable VirtualFile virtualFile, @NotNull List<FileViewProvider> viewProviders) {
@ApiStatus.Internal
public void forceReload(@Nullable VirtualFile virtualFile, @NotNull List<FileViewProvider> viewProviders) {
if (!viewProviders.isEmpty()) {
DebugUtil.performPsiModification("psi.forceReload", () -> {
for (FileViewProvider viewProvider : viewProviders) {
@@ -901,7 +904,8 @@ public abstract class PsiDocumentManagerBase extends PsiDocumentManager implemen
return Collections.unmodifiableMap(myUncommittedDocumentTraces);
}
boolean isInUncommittedSet(@NotNull Document document) {
@ApiStatus.Internal
public boolean isInUncommittedSet(@NotNull Document document) {
return myUncommittedDocuments.contains(getTopLevelDocument(document));
}
@@ -1071,7 +1075,8 @@ public abstract class PsiDocumentManagerBase extends PsiDocumentManager implemen
}
}
void handleCommitWithoutPsi(@NotNull Document document) {
@ApiStatus.Internal
public void handleCommitWithoutPsi(@NotNull Document document) {
UncommittedInfo prevInfo = clearUncommittedInfo(document);
if (prevInfo == null) {
return;
@@ -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.actionSystem;
import org.jetbrains.annotations.ApiStatus;
@@ -130,7 +130,8 @@ public abstract class ActionGroup extends AnAction {
return getChildren(null);
}
final void setAsPrimary(@NotNull AnAction action, boolean isPrimary) {
@ApiStatus.Internal
public final void setAsPrimary(@NotNull AnAction action, boolean isPrimary) {
if (isPrimary) {
if (mySecondaryActions != null) {
mySecondaryActions.remove(action);
@@ -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.openapi.actionSystem;
import com.intellij.DynamicBundle;
@@ -297,7 +297,7 @@ public final class Presentation implements Cloneable {
}
@ApiStatus.Internal // do not expose
void copyUnsetTemplateProperties(@NotNull Presentation other) {
public void copyUnsetTemplateProperties(@NotNull Presentation other) {
if (icon == null) {
icon = other.icon;
}
@@ -130,6 +130,7 @@ public final class FoldingModelWindow implements FoldingModelEx, ModificationTra
}
static final Key<FoldingRegionWindow> FOLD_REGION_WINDOW = Key.create("FOLD_REGION_WINDOW");
@Override
public FoldRegion createFoldRegion(int startOffset, int endOffset, @NotNull String placeholder, FoldingGroup group, boolean neverExpands) {
TextRange hostRange = myDocumentWindow.injectedToHost(new TextRange(startOffset, endOffset));
@@ -138,7 +139,7 @@ public final class FoldingModelWindow implements FoldingModelEx, ModificationTra
if (hostRegion == null) return null;
FoldingRegionWindow window = new FoldingRegionWindow(myDocumentWindow, myEditorWindow, startOffset, endOffset){
@Override
@NotNull RangeMarker createHostRangeMarkerToTrack(@NotNull TextRange hostRange, boolean surviveOnExternalChange) {
public @NotNull RangeMarker createHostRangeMarkerToTrack(@NotNull TextRange hostRange, boolean surviveOnExternalChange) {
return hostRegion;
}
};
@@ -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.psi.impl.source.tree.injected;
import com.intellij.injected.editor.DocumentWindow;
@@ -24,7 +24,7 @@ public abstract class FoldingRegionWindow extends RangeMarkerWindow implements F
myEditorWindow = editorWindow;
}
@Override
abstract @NotNull RangeMarker createHostRangeMarkerToTrack(@NotNull TextRange hostRange, boolean surviveOnExternalChange);
public abstract @NotNull RangeMarker createHostRangeMarkerToTrack(@NotNull TextRange hostRange, boolean surviveOnExternalChange);
@Override
public boolean isExpanded() {
@@ -67,7 +67,8 @@ public class FileChooserDescriptor implements Cloneable {
this(chooseFiles || (chooseJars && !chooseJarContents) || chooseJarsAsFiles, chooseFolders, chooseJarContents, chooseMultiple);
}
FileChooserDescriptor(boolean chooseFiles, boolean chooseFolders, boolean chooseJarContents, boolean chooseMultiple) {
@ApiStatus.Internal
public FileChooserDescriptor(boolean chooseFiles, boolean chooseFolders, boolean chooseJarContents, boolean chooseMultiple) {
this(chooseFiles, chooseFolders, chooseJarContents, chooseMultiple, null);
}
@@ -92,11 +92,11 @@ public abstract class DumbAwareAction extends AnAction implements DumbAware {
LightEditCompatible {
private final java.util.function.Consumer<? super AnActionEvent> myActionPerformed;
SimpleDumbAwareAction(java.util.function.Consumer<? super AnActionEvent> actionPerformed) {
public SimpleDumbAwareAction(java.util.function.Consumer<? super AnActionEvent> actionPerformed) {
myActionPerformed = actionPerformed;
}
SimpleDumbAwareAction(@NlsActions.ActionText String text,
public SimpleDumbAwareAction(@NlsActions.ActionText String text,
java.util.function.Consumer<? super AnActionEvent> actionPerformed) {
super(text);
myActionPerformed = actionPerformed;
@@ -93,10 +93,6 @@ pc:com.intellij.execution.process.CapturingAnsiEscapesAwareProcessHandler$AnsiEs
- <init>(com.intellij.execution.process.ProcessOutput):V
- coloredTextAvailable(java.lang.String,com.intellij.openapi.util.Key):V
- onTextAvailable(com.intellij.execution.process.ProcessEvent,com.intellij.openapi.util.Key):V
f:com.intellij.execution.process.ColoredOutputTypeRegistryImpl
- <init>():V
- s:getAnsiColorKey(I):com.intellij.openapi.editor.colors.TextAttributesKey
- getOutputType(java.lang.String,com.intellij.openapi.util.Key):com.intellij.execution.process.ProcessOutputType
f:com.intellij.execution.process.ConsoleHighlighter
- sf:BLACK:com.intellij.openapi.editor.colors.TextAttributesKey
- sf:BLUE:com.intellij.openapi.editor.colors.TextAttributesKey
@@ -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.process;
import com.intellij.execution.ui.ConsoleViewContentType;
@@ -12,6 +12,7 @@ import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.JBColor;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -24,6 +25,7 @@ import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Supplier;
@ApiStatus.Internal
public final class ColoredOutputTypeRegistryImpl extends ColoredOutputTypeRegistry {
private final Map<String, ProcessOutputType> myStdoutAttrsToKeyMap = new ConcurrentHashMap<>();
private final Map<String, ProcessOutputType> myStderrAttrsToKeyMap = new ConcurrentHashMap<>();
@@ -110,7 +112,7 @@ public final class ColoredOutputTypeRegistryImpl extends ColoredOutputTypeRegist
* later to print to the console
*/
@Override
@NotNull ProcessOutputType getOutputType(@NotNull AnsiTerminalEmulator terminal, @NotNull Key streamType) {
public @NotNull ProcessOutputType getOutputType(@NotNull AnsiTerminalEmulator terminal, @NotNull Key streamType) {
Map<String, ProcessOutputType> attrsToKeyMap = ProcessOutputType.isStdout(streamType) ? myStdoutAttrsToKeyMap : myStderrAttrsToKeyMap;
String ansiSerializedState = terminal.getAnsiSerializedSGRState();
ProcessOutputType key = attrsToKeyMap.get(ansiSerializedState);
@@ -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.
@file:Suppress("FunctionName")
package com.intellij.openapi.ui
@@ -283,11 +283,11 @@ open class ThreeComponentsSplitter @JvmOverloads constructor(vertical: Boolean =
override fun isVisible(): Boolean = super.isVisible() && (firstVisible() || innerVisible() || lastVisible())
protected fun lastVisible(): Boolean = !Splitter.isNull(lastComponent) && lastComponent!!.isVisible
protected fun lastVisible(): Boolean = !NullableComponent.Check.isNull(lastComponent) && lastComponent!!.isVisible
private fun innerVisible(): Boolean = !Splitter.isNull(innerComponent) && innerComponent!!.isVisible
private fun innerVisible(): Boolean = !NullableComponent.Check.isNull(innerComponent) && innerComponent!!.isVisible
protected fun firstVisible(): Boolean = !Splitter.isNull(firstComponent) && firstComponent!!.isVisible
protected fun firstVisible(): Boolean = !NullableComponent.Check.isNull(firstComponent) && firstComponent!!.isVisible
private fun visibleDividersCount(): Int {
var count = 0
@@ -693,6 +693,7 @@ open class ThreeComponentsSplitter @JvmOverloads constructor(vertical: Boolean =
}
}
@Suppress("RedundantVisibilityModifier")
public override fun processMouseMotionEvent(e: MouseEvent) {
super.processMouseMotionEvent(e)
if (!isShowing()) {
@@ -751,6 +752,7 @@ open class ThreeComponentsSplitter @JvmOverloads constructor(vertical: Boolean =
return if (minSize <= maxSize) pos.coerceIn(minSize, maxSize) else pos
}
@Suppress("RedundantVisibilityModifier")
public override fun processMouseEvent(e: MouseEvent) {
super.processMouseEvent(e)
if (!isShowing()) {
@@ -854,7 +856,7 @@ open class ThreeComponentsSplitter @JvmOverloads constructor(vertical: Boolean =
private val SplitGlueV = EmptyIcon.create(17, 6)
private fun validateIfNeeded(c: JComponent?, rect: Rectangle) {
if (c != null && !Splitter.isNull(c)) {
if (c != null && !NullableComponent.Check.isNull(c)) {
if (c.bounds != rect) {
c.bounds = rect
c.revalidate()
@@ -57,8 +57,7 @@ public final class AnsiTerminalEmulator {
private AnsiTerminalColor myBackgroundColor;
private AnsiTerminalColor myForegroundColor;
private final ClearableLazyValue<String> mySerializedSgrStateProvider = ClearableLazyValue.create(
() -> computeAnsiSerializedSGRState());
private final ClearableLazyValue<String> mySerializedSgrStateProvider = ClearableLazyValue.create(this::computeAnsiSerializedSGRState);
/**
* Consumes <a href="https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters">SGR - Select Graphic Rendition</a> control sequence and changes emulator's state accordingly
@@ -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.process;
import com.intellij.openapi.application.ApplicationManager;
@@ -40,7 +40,7 @@ public abstract class ColoredOutputTypeRegistry {
*/
public abstract @NotNull ProcessOutputType getOutputType(@NonNls String attribute, @NotNull Key streamType);
abstract @NotNull ProcessOutputType getOutputType(@NotNull AnsiTerminalEmulator terminal, @NotNull Key streamType);
public abstract @NotNull ProcessOutputType getOutputType(@NotNull AnsiTerminalEmulator terminal, @NotNull Key streamType);
public static ColoredOutputTypeRegistry getInstance() {
return ApplicationManager.getApplication().getService(ColoredOutputTypeRegistry.class);
@@ -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.util.net;
import com.google.common.net.HostAndPort;
@@ -323,7 +323,8 @@ public final class NetUtils {
return SystemProperties.getBooleanProperty("jsse.enableSNIExtension", true);
}
static ProxySelector getProxySelector(@Nullable String pacUrlForUse) {
@ApiStatus.Internal
public static ProxySelector getProxySelector(@Nullable String pacUrlForUse) {
return IoService.getInstance().getProxySelector(pacUrlForUse);
}
@@ -315,7 +315,7 @@ public class Splitter extends JPanel implements Splittable {
}
private static boolean isComponentVisible(JComponent component) {
return !isNull(component) && component.isVisible() && !component.getBounds().isEmpty();
return !NullableComponent.Check.isNull(component) && component.isVisible() && !component.getBounds().isEmpty();
}
private static float getDistributeSizeChange(int size1, int mSize1, int pSize1, int mxSize1,
@@ -422,7 +422,7 @@ public class Splitter extends JPanel implements Splittable {
int total = isVertical() ? height : width;
if (total <= 0) return;
if (!isNull(myFirstComponent) && myFirstComponent.isVisible() && !isNull(mySecondComponent) && mySecondComponent.isVisible()) {
if (!NullableComponent.Check.isNull(myFirstComponent) && myFirstComponent.isVisible() && !NullableComponent.Check.isNull(mySecondComponent) && mySecondComponent.isVisible()) {
// both first and second components are visible
Rectangle firstRect = new Rectangle();
Rectangle dividerRect = new Rectangle();
@@ -459,13 +459,13 @@ public class Splitter extends JPanel implements Splittable {
//myFirstComponent.revalidate();
//mySecondComponent.revalidate();
}
else if (!isNull(myFirstComponent) && myFirstComponent.isVisible()) { // only first component is visible
else if (!NullableComponent.Check.isNull(myFirstComponent) && myFirstComponent.isVisible()) { // only first component is visible
hideNull(mySecondComponent);
myDivider.setVisible(false);
myFirstComponent.setBounds(insets.left, insets.top, width, height);
//myFirstComponent.revalidate();
}
else if (!isNull(mySecondComponent) && mySecondComponent.isVisible()) { // only second component is visible
else if (!NullableComponent.Check.isNull(mySecondComponent) && mySecondComponent.isVisible()) { // only second component is visible
hideNull(myFirstComponent);
myDivider.setVisible(false);
mySecondComponent.setBounds(insets.left, insets.top, width, height);
@@ -531,11 +531,8 @@ public class Splitter extends JPanel implements Splittable {
return isVertical() ? size.getHeight() : size.getWidth();
}
static boolean isNull(Component component) {
return NullableComponent.Check.isNull(component);
}
static void hideNull(Component component) {
@ApiStatus.Internal
public static void hideNull(Component component) {
if (component instanceof NullableComponent) {
if (!component.getBounds().equals(myNullBounds)) {
component.setBounds(myNullBounds);
@@ -1,6 +1,8 @@
// 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.vcs;
import com.intellij.openapi.util.IntellijInternalApi;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -8,7 +10,9 @@ public final class VcsKey {
private final @NotNull String myName;
// to forbid creation outside AbstractVcs
VcsKey(@NotNull @NonNls String name) {
@ApiStatus.Internal
@IntellijInternalApi
public VcsKey(@NotNull @NonNls String name) {
myName = name;
}
@@ -1,10 +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.patterns;
import com.intellij.psi.xml.XmlElement;
import com.intellij.psi.xml.XmlEntityRef;
import com.intellij.psi.xml.XmlText;
import com.intellij.util.ProcessingContext;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -17,8 +18,9 @@ public class XmlElementPattern<T extends XmlElement,Self extends XmlElementPatte
super(condition);
}
public static class Capture extends XmlElementPattern<XmlElement, Capture> {
Capture() {
public static final class Capture extends XmlElementPattern<XmlElement, Capture> {
@ApiStatus.Internal
public Capture() {
super(new InitialPatternCondition<>(XmlElement.class) {
@Override
public boolean accepts(final @Nullable Object o, final ProcessingContext context) {
@@ -28,7 +30,7 @@ public class XmlElementPattern<T extends XmlElement,Self extends XmlElementPatte
}
}
public static class XmlTextPattern extends XmlElementPattern<XmlText, XmlTextPattern> {
public static final class XmlTextPattern extends XmlElementPattern<XmlText, XmlTextPattern> {
XmlTextPattern() {
super(new InitialPatternCondition<>(XmlText.class) {
@Override
@@ -39,7 +41,7 @@ public class XmlElementPattern<T extends XmlElement,Self extends XmlElementPatte
}
}
public static class XmlEntityRefPattern extends XmlElementPattern<XmlEntityRef, XmlEntityRefPattern> {
public static final class XmlEntityRefPattern extends XmlElementPattern<XmlEntityRef, XmlEntityRefPattern> {
XmlEntityRefPattern() {
super(new InitialPatternCondition<>(XmlEntityRef.class) {
@Override
@@ -49,5 +51,4 @@ public class XmlElementPattern<T extends XmlElement,Self extends XmlElementPatte
});
}
}
}