fix method visibility (part 3)

GitOrigin-RevId: 7fac25c2d91c29638f3928b5175f4249b678fefd
This commit is contained in:
Vladimir Krivosheev
2025-02-24 21:28:25 +00:00
committed by intellij-monorepo-bot
parent 67fc20895c
commit e06842e2a5
17 changed files with 73 additions and 70 deletions
@@ -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.daemon;
import com.intellij.lang.annotation.Annotation;
@@ -119,8 +119,7 @@ public abstract class DaemonCodeAnalyzer {
* Internal class for reporting annotator-related statistics
*/
@ApiStatus.Internal
final
class AnnotatorStatistics {
final class AnnotatorStatistics {
/** the annotator this statistics is generated for */
public final Annotator annotator;
/** timestamp (in {@link System#nanoTime} sense) of the {@link #annotator} creation */
@@ -136,7 +135,7 @@ public abstract class DaemonCodeAnalyzer {
/** timestamp (in {@link System#nanoTime} sense) of the moment when all the {@link Annotator#annotate(PsiElement, AnnotationHolder)} methods are called */
public long annotatorFinishStamp;
AnnotatorStatistics(@NotNull Annotator annotator) {
public AnnotatorStatistics(@NotNull Annotator annotator) {
this.annotator = annotator;
}
@@ -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;
@@ -6,6 +6,7 @@ import com.intellij.lang.annotation.HighlightSeverity;
import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.util.UserDataHolderBase;
import com.intellij.psi.PsiFile;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -19,7 +20,8 @@ public final class LocalInspectionToolSession extends UserDataHolderBase {
private final TextRange myRestrictRange;
private final HighlightSeverity myMinimumSeverity;
LocalInspectionToolSession(@NotNull PsiFile file, @NotNull TextRange priorityRange, @NotNull TextRange restrictRange,
@ApiStatus.Internal
public LocalInspectionToolSession(@NotNull PsiFile file, @NotNull TextRange priorityRange, @NotNull TextRange restrictRange,
@Nullable HighlightSeverity minimumSeverity) {
myFile = file;
myPriorityRange = priorityRange;
@@ -1,13 +1,10 @@
// 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.codeInspection.ex;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.util.ArrayUtil;
import com.intellij.util.ArrayUtilRt;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.*;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
@@ -36,7 +33,8 @@ public abstract class InspectionElementsMerger {
return additionalMerger;
}
static void addMerger(@NotNull String shortName, @NotNull InspectionElementsMerger merger) {
@ApiStatus.Internal
public static void addMerger(@NotNull String shortName, @NotNull InspectionElementsMerger merger) {
ourAdditionalMergers.put(shortName, merger);
}
@@ -10,7 +10,7 @@ import org.jetbrains.annotations.NotNull;
@ApiStatus.Internal
public abstract class InjectedEditorWindowTracker {
static InjectedEditorWindowTracker getInstance() {
public static InjectedEditorWindowTracker getInstance() {
return ApplicationManager.getApplication().getService(InjectedEditorWindowTracker.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.psi.stubs;
import com.intellij.lang.ASTNode;
@@ -9,6 +9,7 @@ import com.intellij.psi.PsiElement;
import com.intellij.psi.tree.IElementType;
import com.intellij.util.containers.ContainerUtil;
import kotlin.Unit;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -60,11 +61,13 @@ public abstract class IStubElementType<StubT extends StubElement<?>, PsiT extend
}
}
static void dropRegisteredTypes() {
@ApiStatus.Internal
public static void dropRegisteredTypes() {
lazyExternalIds = NOT_INITIALIZED_SET;
}
static @NotNull List<StubFieldAccessor> loadRegisteredStubElementTypes() {
@ApiStatus.Internal
public static @NotNull List<StubFieldAccessor> loadRegisteredStubElementTypes() {
List<StubFieldAccessor> result = new ArrayList<>();
Logger logger = Logger.getInstance(IStubElementType.class);
@@ -14,7 +14,7 @@ public final class MostlyUShortIntList implements IntUnaryOperator {
private int mySize;
private StrippedIntOpenHashMap myMap;
MostlyUShortIntList(int initialCapacity) {
public MostlyUShortIntList(int initialCapacity) {
myData = new char[initialCapacity];
}
@@ -31,7 +31,7 @@ public final class MostlyUShortIntList implements IntUnaryOperator {
}
}
void add(int value) {
public void add(int value) {
if (value < 0 || value >= IN_MAP) {
initMap().put(mySize, value);
value = IN_MAP;
@@ -37,13 +37,13 @@ public abstract class StubList extends AbstractList<StubBase<?>> {
private @Nullable TempState myTempState = new TempState();
StubList(int initialCapacity) {
public StubList(int initialCapacity) {
myStubData = new MostlyUShortIntList(initialCapacity * 3);
myJoinedChildrenList = new MostlyUShortIntList(initialCapacity);
myJoinedChildrenList.add(0); // indices in this list should be non-zero
}
@NotNull IElementType getStubElementType(int id) {
public @NotNull IElementType getStubElementType(int id) {
return IElementType.find(getStubTypeIndex(id));
}
@@ -63,11 +63,11 @@ public abstract class StubList extends AbstractList<StubBase<?>> {
return myStubData.get(childrenStartIndex(id));
}
int getChildrenCount(int id) {
public int getChildrenCount(int id) {
return myStubData.get(childrenCountIndex(id));
}
void addStub(@NotNull StubBase<?> stub, @Nullable StubBase<?> parent, @Nullable IElementType type) {
public void addStub(@NotNull StubBase<?> stub, @Nullable StubBase<?> parent, @Nullable IElementType type) {
int stubId = size();
stub.id = stubId;
@@ -83,7 +83,7 @@ public abstract class StubList extends AbstractList<StubBase<?>> {
return parentId >= 0 && childId != parentId + 1 && getChildrenCount(parentId) == 0;
}
void addStub(int childId, int parentId, short elementTypeIndex) {
public void addStub(int childId, int parentId, short elementTypeIndex) {
assert myTempState != null;
myStubData.add(elementTypeIndex); myStubData.add(0); myStubData.add(0);
@@ -130,7 +130,8 @@ public abstract class StubList extends AbstractList<StubBase<?>> {
}
}
void prepareForChildren(int parentId, int childrenCount) {
@ApiStatus.Internal
public void prepareForChildren(int parentId, int childrenCount) {
assert myTempState != null;
myTempState.prepareForChildren(parentId, childrenCount);
}
@@ -217,11 +218,12 @@ public abstract class StubList extends AbstractList<StubBase<?>> {
return (List)this;
}
boolean isChildrenLayoutOptimal() {
@ApiStatus.Internal
public boolean isChildrenLayoutOptimal() {
return myTempState == null || myTempState.myTempJoinedChildrenMap == null;
}
boolean areChildrenNonAdjacent(int childId, int parentId) {
public boolean areChildrenNonAdjacent(int childId, int parentId) {
return getParentIndex(childId - 1) != parentId;
}
@@ -323,7 +325,7 @@ final class MaterialStubList extends StubList {
}
@Override
void addStub(@NotNull StubBase<?> stub, @Nullable StubBase<?> parent, @Nullable IElementType type) {
public void addStub(@NotNull StubBase<?> stub, @Nullable StubBase<?> parent, @Nullable IElementType type) {
super.addStub(stub, parent, type);
myPlainList.add(stub);
}
@@ -26,7 +26,7 @@ public final class StubSerializationUtil {
* @param root - serializer which couldn't deserialize stub
* @return message for broken stub format
*/
static @NotNull @NonNls String brokenStubFormat(@NotNull ObjectStubSerializer<?, ?> root, @Nullable PsiFile file) {
public static @NotNull @NonNls String brokenStubFormat(@NotNull ObjectStubSerializer<?, ?> root, @Nullable PsiFile file) {
String fileInfo = file == null ? "" : " in file " + file.getName();
return "Broken stub format" + fileInfo + ", most likely version of " + root + " (" + root.getExternalId() + ") was not updated after serialization changes\n";
}
@@ -1,22 +1,9 @@
/*
* 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.openapi.editor.ex.util;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.util.ArrayUtil;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
/**
@@ -63,7 +50,8 @@ public class SegmentArray {
System.arraycopy(data.myEnds, 0, myEnds, startOffset, len);
}
static int calcCapacity(int currentArraySize, int index) {
@ApiStatus.Internal
public static int calcCapacity(int currentArraySize, int index) {
if (currentArraySize == 0) {
currentArraySize = 16;
}
@@ -199,7 +199,8 @@ public final class DocumentImpl extends UserDataHolderBase implements DocumentEx
/**
* makes range marker without creating the document (which could be expensive)
*/
static @NotNull RangeMarker createRangeMarkerForVirtualFile(@NotNull VirtualFile file,
@ApiStatus.Internal
public static @NotNull RangeMarker createRangeMarkerForVirtualFile(@NotNull VirtualFile file,
int offset,
int startLine,
int startCol,
@@ -224,8 +225,8 @@ public final class DocumentImpl extends UserDataHolderBase implements DocumentEx
tree.addInterval(marker, offset, offset, false, false, false, 0);
return marker;
}
public boolean setAcceptSlashR(boolean accept) {
try {
return myAcceptSlashR;
@@ -244,6 +244,7 @@ public abstract class IntervalTreeImpl<T> extends RedBlackTree<T> implements Int
delta += change;
}
}
void clearDelta() {
if (delta != 0) {
setCachedValues(0, false, 0); // deltaUpToRoot is not valid anymore
@@ -393,6 +394,7 @@ public abstract class IntervalTreeImpl<T> extends RedBlackTree<T> implements Int
return "wRef: " + get();
}
}
private static final class StaticSupplier<T> implements Supplier<T> {
private final T myT;
@@ -416,6 +418,7 @@ public abstract class IntervalTreeImpl<T> extends RedBlackTree<T> implements Int
assert isAcquired(l.writeLock()) : l.writeLock();
}
}
private static boolean isAcquired(@NotNull Lock l) {
@NonNls String s = l.toString();
return s.contains("Locked by thread");
@@ -437,6 +440,7 @@ public abstract class IntervalTreeImpl<T> extends RedBlackTree<T> implements Int
protected abstract @NotNull IntervalNode<T> createNewNode(@NotNull T key, int start, int end,
boolean greedyToLeft, boolean greedyToRight, boolean stickingToRight, int layer);
protected abstract IntervalNode<T> lookupNode(@NotNull T key);
protected abstract void setNode(@NotNull T key, @Nullable IntervalNode<T> node);
private int compareNodes(@NotNull IntervalNode<T> i1, int delta1, @NotNull IntervalNode<T> i2, int delta2, @NotNull List<? super IntervalNode<T>> invalid) {
@@ -1409,11 +1413,13 @@ public abstract class IntervalTreeImpl<T> extends RedBlackTree<T> implements Int
}
// combines iterators for two trees in one using the specified comparator
static @NotNull <T> MarkupIterator<T> mergingOverlappingIterator(@NotNull IntervalTreeImpl<T> tree1,
@NotNull TextRange tree1Range,
@NotNull IntervalTreeImpl<T> tree2,
@NotNull TextRange tree2Range,
@NotNull Comparator<? super T> comparator) {
@ApiStatus.Internal
public static @NotNull <T> MarkupIterator<T> mergingOverlappingIterator(
@NotNull IntervalTreeImpl<T> tree1,
@NotNull TextRange tree1Range,
@NotNull IntervalTreeImpl<T> tree2,
@NotNull TextRange tree2Range,
@NotNull Comparator<? super T> comparator) {
MarkupIterator<T> exact = tree1.overlappingIterator(tree1Range);
MarkupIterator<T> lines = tree2.overlappingIterator(tree2Range);
return MarkupIterator.mergeIterators(exact, lines, comparator);
@@ -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.fileEditor.impl;
import com.intellij.openapi.diagnostic.Logger;
@@ -585,7 +585,8 @@ public final class LoadTextUtil {
}
}
static @NotNull Set<String> detectAllLineSeparators(@NotNull VirtualFile virtualFile) {
@ApiStatus.Internal
public static @NotNull Set<String> detectAllLineSeparators(@NotNull VirtualFile virtualFile) {
byte[] bytes;
try {
bytes = virtualFile.contentsToByteArray();
@@ -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.stubs;
import com.intellij.diagnostic.PluginException;
@@ -18,7 +18,7 @@ import java.util.List;
import java.util.Objects;
@ApiStatus.Internal
public class StubBuilderType {
public final class StubBuilderType {
private static final Logger LOG = Logger.getInstance(StubBuilderType.class);
private final LanguageStubDescriptor myStubDescriptor;
private final List<String> myProperties;
@@ -39,7 +39,7 @@ public class StubBuilderType {
myProperties = Collections.emptyList();
}
StubBuilderType(@NotNull BinaryFileStubBuilder.CompositeBinaryFileStubBuilder binaryFileStubBuilder,
StubBuilderType(@NotNull BinaryFileStubBuilder.CompositeBinaryFileStubBuilder<?> binaryFileStubBuilder,
@Nullable Object binarySubBuilder) {
myStubDescriptor = null;
myBinaryFileStubBuilder = binaryFileStubBuilder;
@@ -47,7 +47,7 @@ public class StubBuilderType {
myProperties = Collections.emptyList();
}
@NotNull Class<?> getClassToBlameInCaseOfException() {
public @NotNull Class<?> getClassToBlameInCaseOfException() {
if (myStubDescriptor != null) {
return myStubDescriptor.getFileElementType().getClass();
}
@@ -45,7 +45,8 @@ public final class StubTreeBuilder {
private StubTreeBuilder() { }
static boolean requiresContentToFindBuilder(@NotNull FileType fileType) {
@ApiStatus.Internal
public static boolean requiresContentToFindBuilder(@NotNull FileType fileType) {
BinaryFileStubBuilder builder = BinaryFileStubBuilders.INSTANCE.forFileType(fileType);
return builder instanceof BinaryFileStubBuilder.CompositeBinaryFileStubBuilder<?>;
}
@@ -35,17 +35,17 @@ final class LazyStubList extends StubList {
}
@Override
void addStub(@NotNull StubBase<?> stub, @Nullable StubBase<?> parent, @Nullable IElementType type) {
public void addStub(@NotNull StubBase<?> stub, @Nullable StubBase<?> parent, @Nullable IElementType type) {
// stub is lazily created, so we already know all structures, so do nothing
}
void addLazyStub(IElementType type, int childIndex, int parentIndex) {
public void addLazyStub(IElementType type, int childIndex, int parentIndex) {
addStub(childIndex, parentIndex, type.getIndex());
mySize++;
}
@Override
boolean areChildrenNonAdjacent(int childId, int parentId) {
public boolean areChildrenNonAdjacent(int childId, int parentId) {
return false;
}
@@ -28,8 +28,7 @@ public abstract class StubTreeSerializerBase<SerializationState> {
stubStringInterner = useStubStringInterner ? StubStringInterner.getInstance() : UnaryOperator.identity();
}
@NotNull
public Stub deserialize(@NotNull InputStream stream) throws IOException, SerializerNotFoundException {
public @NotNull Stub deserialize(@NotNull InputStream stream) throws IOException, SerializerNotFoundException {
FileLocalStringEnumerator storage = new FileLocalStringEnumerator(false);
StubInputStream inputStream = new StubInputStream(stream, storage);
@@ -8,7 +8,10 @@ import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.*;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.Set;
@ApiStatus.Internal
public class ImmutableSyntheticLibrary extends SyntheticLibrary {
@@ -18,12 +21,12 @@ public class ImmutableSyntheticLibrary extends SyntheticLibrary {
private final Condition<? super VirtualFile> myExcludeCondition;
private final int hashCode;
ImmutableSyntheticLibrary(@Nullable String comparisonId,
@NotNull List<? extends VirtualFile> sourceRoots,
@NotNull List<? extends VirtualFile> binaryRoots,
@NotNull Set<? extends VirtualFile> excludedRoots,
@Nullable Condition<? super VirtualFile> excludeCondition,
@Nullable ExcludeFileCondition constantCondition) {
public ImmutableSyntheticLibrary(@Nullable String comparisonId,
@NotNull List<? extends VirtualFile> sourceRoots,
@NotNull List<? extends VirtualFile> binaryRoots,
@NotNull Set<? extends VirtualFile> excludedRoots,
@Nullable Condition<? super VirtualFile> excludeCondition,
@Nullable ExcludeFileCondition constantCondition) {
super(comparisonId, constantCondition);
mySourceRoots = List.copyOf(sourceRoots);
myBinaryRoots = List.copyOf(binaryRoots);