platform.util.ex: IJPL-797 Mark accidentally public platform APIs private

GitOrigin-RevId: 25f1c8d3c8df2b6fbf7cf202d75e50ce0a5996a0
This commit is contained in:
Alexey Kudravtsev
2024-08-02 14:08:07 +02:00
committed by intellij-monorepo-bot
parent 417d044a15
commit 5f9438c2e1
8 changed files with 15 additions and 241 deletions

View File

@@ -23,60 +23,6 @@ f:com.intellij.credentialStore.OneTimeStringKt
- sf:OneTimeString(B[],I,I):com.intellij.credentialStore.OneTimeString
- sf:OneTimeString(B[],I,I,Z):com.intellij.credentialStore.OneTimeString
- bs:OneTimeString$default(B[],I,I,Z,I,java.lang.Object):com.intellij.credentialStore.OneTimeString
*f:com.intellij.diagnostic.Checks
- sf:INVARIANT_IS_NOT_SATISFIED:java.lang.String
- sf:POSTCONDITION_IS_NOT_SATISFIED:java.lang.String
- sf:PRECONDITION_IS_NOT_SATISFIED:java.lang.String
- s:check(java.lang.String,java.util.function.BooleanSupplier):V
- s:check(java.util.function.Supplier,java.util.function.BooleanSupplier):V
- s:check(Z):V
- s:check(Z,java.lang.String):V
- s:check(Z,java.util.function.Supplier):V
- s:checkAndLog(java.lang.Class,java.lang.String,java.util.function.BooleanSupplier):V
- s:checkAndLog(java.lang.Class,java.util.function.Supplier,java.util.function.BooleanSupplier):V
- s:checkAndLog(java.lang.Class,Z):V
- s:checkAndLog(java.lang.Class,Z,java.lang.String):V
- s:checkAndLog(java.lang.Class,Z,java.lang.String,com.intellij.openapi.diagnostic.Attachment[]):V
- s:checkAndLog(java.lang.Class,Z,java.util.function.Supplier):V
- s:checkIndex(I,I):V
- s:checkIndex(I,I,java.lang.String):V
- s:checkIndexAndLog(java.lang.Class,I,I):V
- s:checkIndexAndLog(java.lang.Class,I,I,java.lang.String):V
- s:checkIndexAndLog(java.lang.Class,I,I,java.lang.String,com.intellij.openapi.diagnostic.Attachment[]):V
- s:ensure(java.lang.String,java.util.function.BooleanSupplier):V
- s:ensure(java.util.function.Supplier,java.util.function.BooleanSupplier):V
- s:ensure(Z):V
- s:ensure(Z,java.lang.String):V
- s:ensure(Z,java.util.function.Supplier):V
- s:ensureAndLog(java.lang.Class,java.lang.String,java.util.function.BooleanSupplier):V
- s:ensureAndLog(java.lang.Class,java.util.function.Supplier,java.util.function.BooleanSupplier):V
- s:ensureAndLog(java.lang.Class,Z):V
- s:ensureAndLog(java.lang.Class,Z,java.lang.String):V
- s:ensureAndLog(java.lang.Class,Z,java.lang.String,com.intellij.openapi.diagnostic.Attachment[]):V
- s:ensureAndLog(java.lang.Class,Z,java.util.function.Supplier):V
- s:fail(java.lang.Object):V
- s:logError(java.lang.Class,java.lang.Object,com.intellij.openapi.diagnostic.Attachment[]):V
- s:require(java.lang.String,java.util.function.BooleanSupplier):V
- s:require(java.util.function.Supplier,java.util.function.BooleanSupplier):V
- s:require(Z):V
- s:require(Z,java.lang.String):V
- s:require(Z,java.util.function.Supplier):V
- s:requireAndLog(java.lang.Class,java.lang.String,java.util.function.BooleanSupplier):V
- s:requireAndLog(java.lang.Class,java.util.function.Supplier,java.util.function.BooleanSupplier):V
- s:requireAndLog(java.lang.Class,Z):V
- s:requireAndLog(java.lang.Class,Z,java.lang.String):V
- s:requireAndLog(java.lang.Class,Z,java.lang.String,com.intellij.openapi.diagnostic.Attachment[]):V
- s:requireAndLog(java.lang.Class,Z,java.util.function.Supplier):V
- s:unreachable():V
*f:com.intellij.diagnostic.Checks$IllegalPostconditionException
- java.lang.RuntimeException
- <init>():V
- <init>(java.lang.String):V
- <init>(java.lang.String,java.lang.Throwable):V
- <init>(java.lang.String,java.lang.Throwable,Z,Z):V
- <init>(java.lang.Throwable):V
f:com.intellij.diagnostic.StartUpMeasurerKt
- sf:runActivity(java.lang.String,kotlin.jvm.functions.Function0):java.lang.Object
f:com.intellij.openapi.application.PathManagerEx
- sf:getAppSystemDir():java.nio.file.Path
f:com.intellij.openapi.util.ExtensionsKt
@@ -84,23 +30,8 @@ f:com.intellij.openapi.util.ExtensionsKt
- sf:component2(com.intellij.openapi.util.Pair):java.lang.Object
- sf:toNotNull(com.intellij.openapi.util.Pair):kotlin.Pair
- sf:use(com.intellij.openapi.Disposable,kotlin.jvm.functions.Function1):java.lang.Object
f:com.intellij.util.BinFiles
- sf:INSTANCE:com.intellij.util.BinFiles
- f:getBinFile-kDy-24E(java.lang.String,java.lang.Class):java.nio.file.Path
- f:getDevFilesDir():java.nio.file.Path
f:com.intellij.util.ErrorKt
- sf:throwIfNotEmpty(java.util.List):V
f:com.intellij.util.FileName
- bsf:box-impl(java.lang.String):com.intellij.util.FileName
- s:constructor-impl(java.lang.String):java.lang.String
- equals(java.lang.Object):Z
- s:equals-impl(java.lang.String,java.lang.Object):Z
- sf:equals-impl0(java.lang.String,java.lang.String):Z
- f:getValue():java.lang.String
- hashCode():I
- s:hashCode-impl(java.lang.String):I
- s:toString-impl(java.lang.String):java.lang.String
- bf:unbox-impl():java.lang.String
f:com.intellij.util.JdomKt
- sf:addOptionTag(org.jdom.Element,java.lang.String,java.lang.String):V
- sf:addOptionTag(org.jdom.Element,java.lang.String,java.lang.String,java.lang.String):V
@@ -151,35 +82,12 @@ c:com.intellij.util.containers.HashSet
- <init>(java.util.Collection):V
- clear():V
f:com.intellij.util.containers.LookbackSequenceKt
- bsf:reverse(java.util.Map):java.util.Map
- sf:withPrevious(kotlin.sequences.Sequence):kotlin.sequences.Sequence
f:com.intellij.util.containers.Queue
- <init>(I):V
- addLast(java.lang.Object):V
- clear():V
- isEmpty():Z
- peekFirst():java.lang.Object
- process(com.intellij.util.Processor):Z
- pullFirst():java.lang.Object
- removeLast():java.lang.Object
- size():I
f:com.intellij.util.containers.hash.HashMap
- java.util.HashMap
- <init>():V
- <init>(I):V
- <init>(I,F):V
f:com.intellij.util.flow.FlowKt
- sf:collectLatestUndispatched(kotlinx.coroutines.flow.SharedFlow,kotlin.jvm.functions.Function2,kotlin.coroutines.Continuation):java.lang.Object
- sf:debounceBatch-HG0u8IE(kotlinx.coroutines.flow.Flow,J):kotlinx.coroutines.flow.Flow
- *sf:mapStateIn(kotlinx.coroutines.flow.StateFlow,kotlinx.coroutines.CoroutineScope,kotlinx.coroutines.flow.SharingStarted,kotlin.jvm.functions.Function1):kotlinx.coroutines.flow.StateFlow
- *bs:mapStateIn$default(kotlinx.coroutines.flow.StateFlow,kotlinx.coroutines.CoroutineScope,kotlinx.coroutines.flow.SharingStarted,kotlin.jvm.functions.Function1,I,java.lang.Object):kotlinx.coroutines.flow.StateFlow
- sf:throttle(kotlinx.coroutines.flow.Flow,J):kotlinx.coroutines.flow.Flow
- sf:zipWithNext(kotlinx.coroutines.flow.Flow):kotlinx.coroutines.flow.Flow
- sf:zipWithNext(kotlinx.coroutines.flow.Flow,kotlin.jvm.functions.Function3):kotlinx.coroutines.flow.Flow
f:com.intellij.util.io.Base62
- <init>():V
- s:decode(B[]):B[]
- s:encode(B[]):B[]
f:com.intellij.util.io.CloseableUtil
- sf:runClosingOnFailure(java.lang.AutoCloseable,kotlin.jvm.functions.Function1):java.lang.Object
f:com.intellij.util.io.HttpSecurityUtil

View File

@@ -79,6 +79,7 @@ import java.util.function.Supplier;
*/
@Deprecated
@ApiStatus.Experimental
@ApiStatus.Internal
public final class Checks {
public static final @NotNull @NonNls String PRECONDITION_IS_NOT_SATISFIED = "Precondition is not satisfied";

View File

@@ -1,8 +1,10 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.diagnostic
import org.jetbrains.annotations.ApiStatus.Internal
import org.jetbrains.annotations.NonNls
@Internal
inline fun <T> runActivity(@NonNls name: String, task: () -> T): T {
val activity = if (StartUpMeasurer.isEnabled()) StartUpMeasurer.startActivity(name) else null
val result = task()

View File

@@ -7,6 +7,7 @@ import com.intellij.openapi.util.io.FileUtil
import com.intellij.util.BinFiles.devFilesDir
import com.intellij.util.BinFiles.getBinFile
import com.intellij.util.io.outputStream
import org.jetbrains.annotations.ApiStatus.Internal
import org.jetbrains.annotations.NonNls
import java.nio.file.Path
import kotlin.io.path.exists
@@ -17,6 +18,7 @@ import kotlin.io.path.exists
* Use slashes `/` to separate file path. Path is always relative
*/
@JvmInline
@Internal
value class FileName(val value: @NonNls String) {
override fun toString(): String = value
internal val relativePath: @NonNls String get() = value.trimStart('/').trimEnd('/')
@@ -27,6 +29,7 @@ value class FileName(val value: @NonNls String) {
* Publish your binary file packed in jar in maven (consider using Space), add dependency to it and use [getBinFile] to retrieve it.
* For local development create file in [devFilesDir] in your home dir.
*/
@Internal
object BinFiles {
private const val BIN_FILES_DIR_NAME = "IJBinFiles"
private val lock = Any()

View File

@@ -28,8 +28,3 @@ private class LookbackIterator<T>(private val iterator: Iterator<T>) : Iterator<
}
}
@Deprecated(
message = "Moved to another file",
level = DeprecationLevel.HIDDEN,
)
fun <K, V : Any> Map<K, V>.reverse(): Map<V, K> = reverse()

View File

@@ -1,144 +0,0 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.util.containers;
import com.intellij.util.ArrayUtilRt;
import com.intellij.util.Processor;
import org.jetbrains.annotations.NotNull;
import java.util.Arrays;
/**
* @deprecated use {@link java.util.ArrayDeque} instead
*/
@Deprecated(forRemoval = true)
public final class Queue<T> {
private Object[] myArray;
private int myFirst;
private int myLast;
// if true, elements are located at myFirst..myArray.length and 0..myLast
// otherwise, they are at myFirst..myLast
private boolean isWrapped;
public Queue(int initialCapacity) {
myArray = initialCapacity > 0 ? new Object[initialCapacity] : ArrayUtilRt.EMPTY_OBJECT_ARRAY;
}
public void addLast(T object) {
int currentSize = size();
if (currentSize == myArray.length) {
myArray = normalize(Math.max(currentSize * 3/2, 10));
myFirst = 0;
myLast = currentSize;
isWrapped = false;
}
myArray[myLast] = object;
myLast++;
if (myLast == myArray.length) {
isWrapped = !isWrapped;
myLast = 0;
}
}
public T removeLast() {
if (myLast == 0) {
isWrapped = !isWrapped;
myLast = myArray.length;
}
myLast--;
T result = getRaw(myLast);
myArray[myLast] = null;
return result;
}
private T getRaw(int last) {
//noinspection unchecked
return (T)myArray[last];
}
public boolean isEmpty() {
return size() == 0;
}
public int size() {
return isWrapped ? myArray.length - myFirst + myLast : myLast - myFirst;
}
public T pullFirst() {
T result = peekFirst();
myArray[myFirst] = null;
myFirst++;
if (myFirst == myArray.length) {
myFirst = 0;
isWrapped = !isWrapped;
}
return result;
}
public T peekFirst() {
if (isEmpty()) {
throw new IndexOutOfBoundsException("queue is empty");
}
return getRaw(myFirst);
}
private int copyFromTo(int first, int last, Object[] result, int destinationPos) {
int length = last - first;
System.arraycopy(myArray, first, result, destinationPos, length);
return length;
}
private T @NotNull [] normalize(int capacity) {
@SuppressWarnings("unchecked") T[] result = (T[])new Object[capacity];
return normalize(result);
}
private T @NotNull [] normalize(T[] result) {
if (isWrapped) {
int tailLength = copyFromTo(myFirst, myArray.length, result, 0);
copyFromTo(0, myLast, result, tailLength);
}
else {
copyFromTo(myFirst, myLast, result, 0);
}
return result;
}
public void clear() {
Arrays.fill(myArray, null);
myFirst = myLast = 0;
isWrapped = false;
}
public boolean process(@NotNull Processor<? super T> processor) {
if (isWrapped) {
for (int i = myFirst; i < myArray.length; i++) {
T t = getRaw(i);
if (!processor.process(t)) return false;
}
for (int i = 0; i < myLast; i++) {
T t = getRaw(i);
if (!processor.process(t)) return false;
}
}
else {
for (int i = myFirst; i < myLast; i++) {
T t = getRaw(i);
if (!processor.process(t)) return false;
}
}
return true;
}
@Override
public String toString() {
if (isEmpty()) return "<empty>";
return isWrapped ?
"[ " + sub(myFirst, myArray.length) + " ||| " + sub(0, myLast) + " ]" :
"[ " + sub(myFirst, myLast) + " ]";
}
private Object sub(int start, int end) {
if (start == end) return "";
return Arrays.asList(myArray).subList(start, end);
}
}

View File

@@ -14,35 +14,42 @@ import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
import org.jetbrains.annotations.ApiStatus
import org.jetbrains.annotations.ApiStatus.Internal
import kotlin.time.Duration
@Deprecated("Moved to com.intellij.platform.util.coroutines.flow", level = DeprecationLevel.ERROR)
@Internal
fun <X> Flow<X>.throttle(timeMs: Long): Flow<X> {
return throttle(timeMs)
}
@Deprecated("Moved to com.intellij.platform.util.coroutines.flow", level = DeprecationLevel.ERROR)
@Internal
suspend fun <X> SharedFlow<X>.collectLatestUndispatched(action: suspend (value: X) -> Unit) {
collectLatestUndispatched(action)
}
@Deprecated("Moved to com.intellij.platform.util.coroutines.flow", level = DeprecationLevel.ERROR)
@Internal
fun <T, R> Flow<T>.zipWithNext(transform: suspend (a: T, b: T) -> R): Flow<R> {
return zipWithNext(transform)
}
@Deprecated("Moved to com.intellij.platform.util.coroutines.flow", level = DeprecationLevel.ERROR)
@Internal
fun <T> Flow<T>.zipWithNext(): Flow<Pair<T, T>> {
return zipWithNext()
}
@Deprecated("Moved to com.intellij.platform.util.coroutines.flow", level = DeprecationLevel.ERROR)
@Internal
fun <T> Flow<T>.debounceBatch(duration: Duration): Flow<List<T>> {
return debounceBatch(duration)
}
@ApiStatus.Experimental
@Deprecated("Moved to com.intellij.platform.util.coroutines.flow", level = DeprecationLevel.ERROR)
@Internal
fun <T, M> StateFlow<T>.mapStateIn(
coroutineScope: CoroutineScope,
started: SharingStarted = SharingStarted.Eagerly,

View File

@@ -2,6 +2,7 @@
package com.intellij.util.io;
import com.intellij.openapi.util.io.BufferExposingByteArrayOutputStream;
import org.jetbrains.annotations.ApiStatus;
/**
* A Base62 encoder/decoder.
@@ -10,6 +11,7 @@ import com.intellij.openapi.util.io.BufferExposingByteArrayOutputStream;
*
* @author Sebastian Ruhleder, sebastian@seruco.io
*/
@ApiStatus.Internal
public final class Base62 {
private static final int STANDARD_BASE = 256;
private static final int TARGET_BASE = 62;