mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[util] API cleanup: remove unused deprecated API (IDEA-305637)
GitOrigin-RevId: 45626c142a4972050ef21c30e74abd9b3c69ca03
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4e9fa95c06
commit
46313c3e03
@@ -1,8 +1,6 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.util;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
@@ -24,10 +22,4 @@ public final class SystemInfoRt {
|
||||
|
||||
public static final boolean isFileSystemCaseSensitive =
|
||||
isUnix && !isMac || "true".equalsIgnoreCase(System.getProperty("idea.case.sensitive.fs"));
|
||||
|
||||
private static final String ARCH_DATA_MODEL = System.getProperty("sun.arch.data.model");
|
||||
/** @deprecated inexact, please use {@code com.intellij.util.system.CpuArch} instead */
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval
|
||||
public static final boolean is64Bit = !(ARCH_DATA_MODEL == null || ARCH_DATA_MODEL.equals("32"));
|
||||
}
|
||||
|
||||
@@ -233,10 +233,5 @@ public final class SystemInfo {
|
||||
@ApiStatus.ScheduledForRemoval
|
||||
public static final boolean isMacOSMountainLion = isMac;
|
||||
|
||||
/** @deprecated always true (Java 8 requires Windows Vista / Server 2008) */
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval
|
||||
public static final boolean isWinVistaOrNewer = isWindows;
|
||||
|
||||
//</editor-fold>
|
||||
}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// 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.
|
||||
package com.intellij.util;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@@ -65,47 +63,4 @@ public final class LazyInitializer {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #create(Supplier)}
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval
|
||||
public static abstract class NotNullValue<T> implements Supplier<T> {
|
||||
public NotNullValue() {
|
||||
}
|
||||
|
||||
public abstract @NotNull T initialize();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private volatile T value = (T)UNINITIALIZED_VALUE;
|
||||
|
||||
/**
|
||||
* Initializes the value if necessary and returns it.
|
||||
*/
|
||||
@Nullable
|
||||
public T get() {
|
||||
T v = value;
|
||||
if (v != UNINITIALIZED_VALUE) {
|
||||
return value;
|
||||
}
|
||||
|
||||
//noinspection SynchronizeOnThis
|
||||
synchronized (this) {
|
||||
v = value;
|
||||
if (v != UNINITIALIZED_VALUE) {
|
||||
return value;
|
||||
}
|
||||
|
||||
v = initialize();
|
||||
value = v;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -812,17 +812,6 @@ public final class ContainerUtil {
|
||||
return hashMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Collections#emptyList()} instead
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval
|
||||
@Contract(pure = true)
|
||||
@Unmodifiable
|
||||
public static @NotNull <T> Iterable<T> emptyIterable() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Contract(pure=true)
|
||||
public static <T> T find(T @NotNull [] array, @NotNull Condition<? super T> condition) {
|
||||
for (T element : array) {
|
||||
|
||||
@@ -13,17 +13,9 @@ public class BooleanTableCellEditor extends DefaultCellEditor {
|
||||
@SuppressWarnings("DeprecatedIsStillUsed")
|
||||
@Deprecated
|
||||
public BooleanTableCellEditor(boolean isStringEditor) {
|
||||
this(isStringEditor, SwingConstants.CENTER);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated there seems to be no need to change default options, use {@link #BooleanTableCellEditor()} instead.
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public BooleanTableCellEditor(boolean isStringEditor, int horizontalAlignment) {
|
||||
super(new JCheckBox());
|
||||
myStringEditor = isStringEditor;
|
||||
((JCheckBox) editorComponent).setHorizontalAlignment(horizontalAlignment);
|
||||
((JCheckBox) editorComponent).setHorizontalAlignment(SwingConstants.CENTER);
|
||||
}
|
||||
|
||||
public BooleanTableCellEditor() {
|
||||
|
||||
@@ -1,95 +0,0 @@
|
||||
// Copyright 2000-2019 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.
|
||||
package com.intellij.util.ui;
|
||||
|
||||
import com.intellij.ui.Gray;
|
||||
|
||||
import javax.swing.border.Border;
|
||||
import java.awt.*;
|
||||
|
||||
/** @deprecated ancient HiDPI-unfriendly component */
|
||||
@Deprecated(forRemoval = true)
|
||||
@SuppressWarnings({"UseDPIAwareInsets", "UseJBColor", "unused", "SpellCheckingInspection"})
|
||||
public class BlockBorder implements Border {
|
||||
private static final Insets DEFAULT_INSETS = new Insets(1, 1, 3, 3);
|
||||
private static final Color DEFAULT_SHADE1 = Gray._203;
|
||||
private static final Color DEFAULT_SHADE2 = Gray._238;
|
||||
private static final Insets EMPTY = new Insets(0, 0, 0, 0);
|
||||
|
||||
private final Insets myInsets;
|
||||
private final Insets myOuterMargin;
|
||||
private Color myBoundsColor = Color.GRAY;
|
||||
private final Color myShade1;
|
||||
private final Color myShade2;
|
||||
|
||||
public BlockBorder() {
|
||||
this(null, null, DEFAULT_SHADE1, DEFAULT_SHADE2);
|
||||
}
|
||||
|
||||
public BlockBorder(Insets outerMargin, Insets innerMargin) {
|
||||
this(outerMargin, innerMargin, DEFAULT_SHADE1, DEFAULT_SHADE2);
|
||||
}
|
||||
|
||||
public BlockBorder(Insets outerMargin, Insets innerMargin, Color aShade1, Color aShade2) {
|
||||
if (outerMargin == null) {
|
||||
outerMargin = EMPTY;
|
||||
}
|
||||
myOuterMargin = (Insets)outerMargin.clone();
|
||||
myInsets = (Insets)outerMargin.clone();
|
||||
myInsets.top += DEFAULT_INSETS.top;
|
||||
myInsets.left += DEFAULT_INSETS.left;
|
||||
myInsets.bottom += DEFAULT_INSETS.bottom;
|
||||
myInsets.right += DEFAULT_INSETS.right;
|
||||
|
||||
if (innerMargin == null) {
|
||||
innerMargin = EMPTY;
|
||||
}
|
||||
myInsets.top += innerMargin.top;
|
||||
myInsets.left += innerMargin.left;
|
||||
myInsets.bottom += innerMargin.bottom;
|
||||
myInsets.right += innerMargin.right;
|
||||
|
||||
myShade1 = aShade1;
|
||||
myShade2 = aShade2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBorderOpaque() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintBorder(Component component, Graphics g, int x, int y, int width, int height) {
|
||||
Graphics2D g2 = (Graphics2D)g;
|
||||
|
||||
g2.setPaint(getBoundsColor());
|
||||
int horMargin = myOuterMargin.left + myOuterMargin.right;
|
||||
int vertMargin = myOuterMargin.top + myOuterMargin.bottom;
|
||||
|
||||
g2.drawRect(x + myOuterMargin.left, y + myOuterMargin.top, x + width - 3 - horMargin, y + height - 3 - vertMargin);
|
||||
g2.setPaint(myShade1);
|
||||
|
||||
g2.drawLine(x + 1 + myOuterMargin.left, y + height - 2 - myOuterMargin.bottom, x + width - 2 - myOuterMargin.right,
|
||||
y + height - 2 - myOuterMargin.bottom);
|
||||
g2.drawLine(x + width - 2 - myOuterMargin.right, y + 1 + myOuterMargin.bottom, x + width - 2 - myOuterMargin.right,
|
||||
y + height - 2 - myOuterMargin.bottom);
|
||||
|
||||
g2.setPaint(myShade2);
|
||||
g2.drawLine(x + 2 + myOuterMargin.left, y + height - 1 - myOuterMargin.bottom, x + width - 1 - myOuterMargin.right,
|
||||
y + height - 1 - myOuterMargin.bottom);
|
||||
g2.drawLine(x + width - 1 - myOuterMargin.right, y + 2 + myOuterMargin.top, x + width - 1 - myOuterMargin.right,
|
||||
y + height - 1 - myOuterMargin.bottom);
|
||||
}
|
||||
|
||||
private Color getBoundsColor() {
|
||||
return myBoundsColor;
|
||||
}
|
||||
|
||||
public void setBoundsColor(Color aColor) {
|
||||
myBoundsColor = aColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Insets getBorderInsets(Component component) {
|
||||
return (Insets)myInsets.clone();
|
||||
}
|
||||
}
|
||||
@@ -61,14 +61,6 @@ import java.util.Map;
|
||||
return create(base.getIconWidth(), base.getIconHeight());
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@linkplain #create(int)} for caching.
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public EmptyIcon(int size) {
|
||||
this(size, size, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@linkplain #create(int, int)} for caching.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user