void (Method method, List<Location> allLineLocations, DebugProcessImpl debugProcess, FilteredRequestor requestor) { MethodBytecodeUtil.visit(method, new MethodVisitor(Opcodes.API_VERSION) { int myLastLine = 0; @Override public void visitLineNumber(int line, Label start) { myLastLine = line; } @Override public void visitInsn(int opcode) { switch (opcode) { case Opcodes.RETURN: case Opcodes.IRETURN: case Opcodes.FRETURN: case Opcodes.ARETURN: case Opcodes.LRETURN: case Opcodes.DRETURN: //case Opcodes.ATHROW: allLineLocations.stream() .filter(l -> l.lineNumber() == myLastLine) .findFirst().ifPresent(location -> { createLocationBreakpointRequest(requestor, location, debugProcess, false); }); } } }, true); }