diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/JumpToObjectAction.java b/java/debugger/impl/src/com/intellij/debugger/actions/JumpToObjectAction.java index 32f139779aa0..ce1c22c5e037 100644 --- a/java/debugger/impl/src/com/intellij/debugger/actions/JumpToObjectAction.java +++ b/java/debugger/impl/src/com/intellij/debugger/actions/JumpToObjectAction.java @@ -115,14 +115,9 @@ public class JumpToObjectAction extends DebuggerAction{ if (cls != null) { Method method = ContainerUtil.getFirstItem(cls.methodsByName(name)); if (method != null) { - try { - Location loc = ContainerUtil.getFirstItem(method.allLineLocations()); - if (loc != null) { - locationRef.set(loc); - } - } - catch (AbsentInformationException e) { - LOG.debug(e); + Location loc = ContainerUtil.getFirstItem(DebuggerUtilsEx.allLineLocations(method)); + if (loc != null) { + locationRef.set(loc); } } } diff --git a/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerUtilsEx.java b/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerUtilsEx.java index 9f479a2b1cff..4f7894429347 100644 --- a/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerUtilsEx.java +++ b/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerUtilsEx.java @@ -591,6 +591,16 @@ public abstract class DebuggerUtilsEx extends DebuggerUtils { return new SigReader(s).getSignature(); } + @NotNull + public static List allLineLocations(Method method) { + try { + return method.allLineLocations(); + } + catch (AbsentInformationException ignored) { + return Collections.emptyList(); + } + } + public static Value createValue(VirtualMachineProxyImpl vm, String expectedType, double value) { if (PsiType.DOUBLE.getPresentableText().equals(expectedType)) { return vm.mirrorOf(value); diff --git a/java/debugger/impl/src/com/intellij/debugger/impl/SourceCodeChecker.java b/java/debugger/impl/src/com/intellij/debugger/impl/SourceCodeChecker.java index 17bc80fd50bf..87d229c438e2 100644 --- a/java/debugger/impl/src/com/intellij/debugger/impl/SourceCodeChecker.java +++ b/java/debugger/impl/src/com/intellij/debugger/impl/SourceCodeChecker.java @@ -91,13 +91,11 @@ public class SourceCodeChecker { catch (EvaluateException e) { LOG.info(e); } - catch (AbsentInformationException ignore) { - } } }); } - private static ThreeState check(Location location, SourcePosition position, Project project) throws AbsentInformationException { + private static ThreeState check(Location location, SourcePosition position, Project project) { Method method = location.method(); // for now skip constructors, bridges, lambdas etc. if (method.isConstructor() || @@ -108,7 +106,7 @@ public class SourceCodeChecker { LambdaMethodFilter.isLambdaName(method.name())) { return ThreeState.UNSURE; } - List locations = method.allLineLocations(); + List locations = DebuggerUtilsEx.allLineLocations(method); if (ContainerUtil.isEmpty(locations)) { return ThreeState.UNSURE; } diff --git a/java/debugger/impl/src/com/intellij/debugger/jdi/MethodBytecodeUtil.java b/java/debugger/impl/src/com/intellij/debugger/jdi/MethodBytecodeUtil.java index e78a9b886c10..e2954617b8b2 100644 --- a/java/debugger/impl/src/com/intellij/debugger/jdi/MethodBytecodeUtil.java +++ b/java/debugger/impl/src/com/intellij/debugger/jdi/MethodBytecodeUtil.java @@ -15,6 +15,7 @@ */ package com.intellij.debugger.jdi; +import com.intellij.debugger.impl.DebuggerUtilsEx; import com.intellij.util.ReflectionUtil; import com.intellij.util.ThrowableConsumer; import com.sun.jdi.*; @@ -26,7 +27,6 @@ import org.jetbrains.org.objectweb.asm.Type; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; -import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -180,7 +180,7 @@ public class MethodBytecodeUtil { dos.writeInt(bytecodes.length); // code_length dos.write(bytecodes); // code dos.writeShort(0); // exception_table_length - List locations = getMethodLocations(method); + List locations = DebuggerUtilsEx.allLineLocations(method); if (!locations.isEmpty()) { dos.writeShort(1); // attributes_count dos.writeShort(cw.newUTF8("LineNumberTable")); @@ -197,16 +197,6 @@ public class MethodBytecodeUtil { }); } - @NotNull - private static List getMethodLocations(Method method) { - try { - return method.allLineLocations(); - } - catch (AbsentInformationException ignored) { - return Collections.emptyList(); - } - } - private static final Type OBJECT_TYPE = Type.getObjectType("java/lang/Object"); public static Type getVarInstructionType(int opcode) { diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/MethodBreakpoint.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/MethodBreakpoint.java index 8727d201f606..71708b2ab9d7 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/MethodBreakpoint.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/MethodBreakpoint.java @@ -155,7 +155,7 @@ public class MethodBreakpoint extends BreakpointWithHighlighter allLineLocations = method.allLineLocations(); + List allLineLocations = DebuggerUtilsEx.allLineLocations(method); if (!allLineLocations.isEmpty()) { if (isWatchEntry()) { createLocationBreakpointRequest(ContainerUtil.getFirstItem(allLineLocations), debugProcess);