use of com.sun.jdi.ObjectCollectedException in project intellij-community by JetBrains.
the class SpringLoadedPositionManager method findNested.
private static void findNested(Set<ReferenceType> res, ReferenceType fromClass, int line) {
if (!fromClass.isPrepared())
return;
List<ReferenceType> nestedTypes = fromClass.nestedTypes();
ReferenceType springLoadedGeneratedClass = null;
for (ReferenceType nested : nestedTypes) {
if (!nested.isPrepared())
continue;
if (isSpringLoadedGeneratedClass(fromClass, nested)) {
if (springLoadedGeneratedClass == null || !springLoadedGeneratedClass.name().equals(nested.name())) {
// Only latest generated classes should be used.
springLoadedGeneratedClass = nested;
}
} else {
findNested(res, nested, line);
}
}
try {
final int lineNumber = line + 1;
ReferenceType effectiveRef = springLoadedGeneratedClass == null ? fromClass : springLoadedGeneratedClass;
if (!effectiveRef.locationsOfLine(lineNumber).isEmpty()) {
res.add(effectiveRef);
}
} catch (ObjectCollectedException | AbsentInformationException ignored) {
}
}
use of com.sun.jdi.ObjectCollectedException in project kotlin by JetBrains.
the class DebuggerSteppingHelper method createStepRequest.
// copied from DebugProcessImpl.doStep
private static void createStepRequest(@NotNull SuspendContextImpl suspendContext, @Nullable ThreadReferenceProxyImpl stepThread, @NotNull EventRequestManager requestManager, int size, int depth) {
if (stepThread == null) {
return;
}
try {
ThreadReference stepThreadReference = stepThread.getThreadReference();
requestManager.deleteEventRequests(requestManager.stepRequests());
StepRequest stepRequest = requestManager.createStepRequest(stepThreadReference, size, depth);
List<ClassFilter> activeFilters = getActiveFilters();
if (!activeFilters.isEmpty()) {
String currentClassName = getCurrentClassName(stepThread);
if (currentClassName == null || !DebuggerUtilsEx.isFiltered(currentClassName, activeFilters)) {
// add class filters
for (ClassFilter filter : activeFilters) {
stepRequest.addClassExclusionFilter(filter.getPattern());
}
}
}
// suspend policy to match the suspend policy of the context:
// if all threads were suspended, then during stepping all the threads must be suspended
// if only event thread were suspended, then only this particular thread must be suspended during stepping
stepRequest.setSuspendPolicy(suspendContext.getSuspendPolicy() == EventRequest.SUSPEND_EVENT_THREAD ? EventRequest.SUSPEND_EVENT_THREAD : EventRequest.SUSPEND_ALL);
stepRequest.enable();
} catch (ObjectCollectedException ignored) {
}
}
Aggregations