[debugger] dropped obsolete jdk patches checks

GitOrigin-RevId: e10a83b5ecfafa9fa065fee3dc203124715a344f
This commit is contained in:
Egor Ushakov
2020-11-24 13:26:15 +03:00
committed by intellij-monorepo-bot
parent aee4e47937
commit cfaadbb743
3 changed files with 1 additions and 46 deletions

View File

@@ -1,13 +1,11 @@
// Copyright 2000-2020 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.debugger.jdi;
import com.intellij.Patches;
import com.intellij.debugger.engine.DebuggerUtils;
import com.intellij.debugger.impl.DebuggerUtilsEx;
import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.io.BufferExposingByteArrayOutputStream;
import com.intellij.util.ArrayUtil;
import com.intellij.util.ReflectionUtil;
import com.intellij.util.ThrowableConsumer;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.MultiMap;
@@ -45,27 +43,12 @@ public final class MethodBytecodeUtil {
}
}
public static byte[] getConstantPool(ReferenceType type) {
if (Patches.JDK_BUG_ID_6822627) {
try {
return type.constantPool();
}
catch (NullPointerException e) { // workaround for JDK bug 6822627
ReflectionUtil.resetField(type, "constantPoolInfoGotten");
return type.constantPool();
}
}
else {
return type.constantPool();
}
}
private static void visit(Method method, byte[] bytecodes, MethodVisitor methodVisitor, boolean withLineNumbers) {
ReferenceType type = method.declaringType();
BufferExposingByteArrayOutputStream bytes = new BufferExposingByteArrayOutputStream();
try (DataOutputStream dos = new DataOutputStream(bytes)) {
writeClassHeader(dos, type.constantPoolCount(), getConstantPool(type));
writeClassHeader(dos, type.constantPoolCount(), type.constantPool());
}
catch (IOException e) { throw new RuntimeException(e); }
ClassReader reader = new ClassReader(bytes.getInternalBuffer(), 0, bytes.size());

View File

@@ -5,21 +5,16 @@
*/
package com.intellij.debugger.jdi;
import com.intellij.Patches;
import com.intellij.debugger.engine.DebugProcess;
import com.intellij.debugger.engine.DebugProcessImpl;
import com.intellij.debugger.engine.DebuggerManagerThreadImpl;
import com.intellij.debugger.engine.DebuggerUtils;
import com.intellij.debugger.engine.evaluation.EvaluateException;
import com.intellij.debugger.engine.jdi.VirtualMachineProxy;
import com.intellij.debugger.impl.DebuggerUtilsImpl;
import com.intellij.debugger.impl.PrioritizedTask;
import com.intellij.debugger.impl.attach.SAJDWPRemoteConnection;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.ThrowableComputable;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.ReflectionUtil;
import com.intellij.util.ThreeState;
import com.sun.jdi.*;
import com.sun.jdi.event.EventQueue;
@@ -339,18 +334,6 @@ public class VirtualMachineProxyImpl implements JdiTimer, VirtualMachineProxy {
catch (UnsupportedOperationException e) {
LOG.info(e);
}
finally {
if (Patches.JDK_BUG_EVENT_CONTROLLER_LEAK) {
// Memory leak workaround, see IDEA-163334
Object target = ReflectionUtil.getField(myVirtualMachine.getClass(), myVirtualMachine, null, "target");
if (target != null) {
Thread controller = ReflectionUtil.getField(target.getClass(), target, Thread.class, "eventController");
if (controller != null) {
controller.stop();
}
}
}
}
}
public void exit(int i) {