SourcePosition (DebugProcess debugProcess, Location location, PsiFile file, int lineNumber) { if (debugProcess.getVirtualMachineProxy().canGetBytecodes()) { PsiElement ret = JavaLineBreakpointType.findSingleConditionalReturn(file, lineNumber); if (ret != null) { byte[] bytecodes = DebuggerUtilsEx.getMethod(location).bytecodes(); int bytecodeOffs = Math.toIntExact(location.codeIndex()); // Implicit return instruction at the end of bytecode should not be treated as conditional return. // (Note that we also relay on the fact that all return instructions have no operands.) if (0 <= bytecodeOffs && bytecodeOffs < bytecodes.length - 1) { int opcode = bytecodes[bytecodeOffs] & 0xFF; if (Opcodes.IRETURN <= opcode && opcode <= Opcodes.RETURN) { return SourcePosition.createFromOffset(file, ret.getTextOffset()); } } } } return null; }