EA-377269 - IOE: ReflectionUtil.makeAccessible

GitOrigin-RevId: 06c754f38e7f082b1af81e0af884fd7306f870a1
This commit is contained in:
Egor Ushakov
2021-09-30 19:43:21 +03:00
committed by intellij-monorepo-bot
parent c9d1c86ff8
commit 7dfc75c3de

View File

@@ -1,4 +1,4 @@
// 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. 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.ui.breakpoints;
import com.intellij.debugger.JavaDebuggerBundle;
@@ -12,11 +12,13 @@ import com.intellij.openapi.project.Project;
import com.intellij.util.ReflectionUtil;
import com.intellij.util.containers.ContainerUtil;
import com.jetbrains.jdi.ReferenceTypeImpl;
import com.jetbrains.jdi.VirtualMachineImpl;
import com.sun.jdi.*;
import com.sun.jdi.event.LocatableEvent;
import one.util.streamex.StreamEx;
import org.jetbrains.annotations.NotNull;
import java.lang.reflect.InaccessibleObjectException;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
@@ -34,14 +36,14 @@ public final class InstrumentationTracker {
try {
redefineMethod = ReflectionUtil.getDeclaredMethod(Class.forName("com.sun.tools.jdi.ReferenceTypeImpl"), "noticeRedefineClass");
}
catch (ClassNotFoundException e) {
catch (ClassNotFoundException | InaccessibleObjectException e) {
LOG.warn(e);
}
ourNoticeRedefineClassMethod = redefineMethod;
}
public static void track(DebugProcessImpl debugProcess) {
if (ourNoticeRedefineClassMethod != null) {
if (ourNoticeRedefineClassMethod != null || debugProcess.getVirtualMachineProxy().getVirtualMachine() instanceof VirtualMachineImpl) {
new InstrumentationTracker(debugProcess);
}
}