mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
use the correct Patches const
This commit is contained in:
@@ -1199,11 +1199,6 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
|
||||
}.start((EvaluationContextImpl)evaluationContext, internalEvaluate);
|
||||
}
|
||||
|
||||
static {
|
||||
//noinspection ConstantConditions
|
||||
assert Patches.USE_REFLECTION_TO_ACCESS_JDK8;
|
||||
}
|
||||
|
||||
public Value invokeMethod(EvaluationContext evaluationContext,
|
||||
InterfaceType interfaceType,
|
||||
Method method,
|
||||
@@ -1218,20 +1213,25 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Invoking " + interfaceType.name() + "." + method.name());
|
||||
}
|
||||
//TODO: remove reflection after move to java 8 or 9, this API was introduced in 1.8.0_45
|
||||
java.lang.reflect.Method invokeMethod =
|
||||
ReflectionUtil.getMethod(InterfaceType.class, "invokeMethod", ThreadReference.class, Method.class, List.class, int.class);
|
||||
if (invokeMethod == null) {
|
||||
throw new IllegalStateException("Interface method invocation is not supported in JVM " +
|
||||
SystemInfo.JAVA_VERSION +
|
||||
". Use JVM 1.8.0_45 or higher to run " +
|
||||
ApplicationNamesInfo.getInstance().getFullProductName());
|
||||
if (Patches.JDK_BUG_ID_8042123) {
|
||||
//TODO: remove reflection after move to java 8 or 9, this API was introduced in 1.8.0_45
|
||||
java.lang.reflect.Method invokeMethod =
|
||||
ReflectionUtil.getMethod(InterfaceType.class, "invokeMethod", ThreadReference.class, Method.class, List.class, int.class);
|
||||
if (invokeMethod == null) {
|
||||
throw new IllegalStateException("Interface method invocation is not supported in JVM " +
|
||||
SystemInfo.JAVA_VERSION +
|
||||
". Use JVM 1.8.0_45 or higher to run " +
|
||||
ApplicationNamesInfo.getInstance().getFullProductName());
|
||||
}
|
||||
try {
|
||||
return (Value)invokeMethod.invoke(interfaceType, thread, method, args, invokePolicy);
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
try {
|
||||
return (Value)invokeMethod.invoke(interfaceType, thread, method, args, invokePolicy);
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
else {
|
||||
return interfaceType.invokeMethod(thread, method, args, invokePolicy);
|
||||
}
|
||||
}
|
||||
}.start((EvaluationContextImpl)evaluationContext, false);
|
||||
|
||||
Reference in New Issue
Block a user