mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +07:00
KTIJ-29067 Add deprecation annotations for trove4j interfaces
GitOrigin-RevId: d4114ad9661bcded677692c3c8e5b9d25fe2d61d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
81a6f4010a
commit
f6726c0876
@@ -8,6 +8,11 @@ import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Proxy;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @deprecated This class is used to support the old Kotlin JPS plugin (1.6.*) bundled in Spring 2.*
|
||||
* Please don't use it in your code and don't remove (KTIJ-29067)
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.Internal
|
||||
public interface Equality<T> {
|
||||
boolean equals(T o1, T o2);
|
||||
@@ -17,7 +22,7 @@ public interface Equality<T> {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
static <T> Equality<T> createIdentityEquality() {
|
||||
return (Equality<T>) Proxy.newProxyInstance(
|
||||
return (Equality<T>)Proxy.newProxyInstance(
|
||||
Equality.class.getClassLoader(),
|
||||
new Class<?>[]{Equality.class},
|
||||
new InvocationHandler() {
|
||||
@@ -34,7 +39,7 @@ public interface Equality<T> {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
static <T> Equality<T> createCanonicalEquality() {
|
||||
return (Equality<T>) Proxy.newProxyInstance(
|
||||
return (Equality<T>)Proxy.newProxyInstance(
|
||||
Equality.class.getClassLoader(),
|
||||
new Class<?>[]{Equality.class},
|
||||
new InvocationHandler() {
|
||||
|
||||
@@ -8,9 +8,15 @@ import java.lang.reflect.InvocationHandler;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Proxy;
|
||||
|
||||
/**
|
||||
* @deprecated This class is used to support the old Kotlin JPS plugin (1.6.*) bundled in Spring 2.*
|
||||
* Please don't use it in your code and don't remove (KTIJ-29067)
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.Internal
|
||||
public interface TObjectHashingStrategy<T> extends Serializable {
|
||||
int computeHashCode(T object);
|
||||
|
||||
boolean equals(T o1, T o2);
|
||||
|
||||
TObjectHashingStrategy<Object> IDENTITY = createIdentityStrategy();
|
||||
@@ -18,7 +24,7 @@ public interface TObjectHashingStrategy<T> extends Serializable {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
static <T> TObjectHashingStrategy<T> createIdentityStrategy() {
|
||||
return (TObjectHashingStrategy<T>) Proxy.newProxyInstance(
|
||||
return (TObjectHashingStrategy<T>)Proxy.newProxyInstance(
|
||||
TObjectHashingStrategy.class.getClassLoader(),
|
||||
new Class<?>[]{TObjectHashingStrategy.class},
|
||||
new InvocationHandler() {
|
||||
@@ -26,7 +32,8 @@ public interface TObjectHashingStrategy<T> extends Serializable {
|
||||
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
|
||||
if ("computeHashCode".equals(method.getName())) {
|
||||
return System.identityHashCode(args[0]);
|
||||
} else if ("equals".equals(method.getName())) {
|
||||
}
|
||||
else if ("equals".equals(method.getName())) {
|
||||
return args[0] == args[1];
|
||||
}
|
||||
throw new UnsupportedOperationException("Unsupported method: " + method.getName());
|
||||
@@ -37,7 +44,7 @@ public interface TObjectHashingStrategy<T> extends Serializable {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
static <T> TObjectHashingStrategy<T> createCanonicalStrategy() {
|
||||
return (TObjectHashingStrategy<T>) Proxy.newProxyInstance(
|
||||
return (TObjectHashingStrategy<T>)Proxy.newProxyInstance(
|
||||
TObjectHashingStrategy.class.getClassLoader(),
|
||||
new Class<?>[]{TObjectHashingStrategy.class},
|
||||
new InvocationHandler() {
|
||||
@@ -45,7 +52,8 @@ public interface TObjectHashingStrategy<T> extends Serializable {
|
||||
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
|
||||
if ("computeHashCode".equals(method.getName())) {
|
||||
return args[0] != null ? args[0].hashCode() : 0;
|
||||
} else if ("equals".equals(method.getName())) {
|
||||
}
|
||||
else if ("equals".equals(method.getName())) {
|
||||
if (args[0] == null) {
|
||||
return args[1] == null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user