LinkInTrace (@NotNull final PyFilesStateMachine machine) { final Pair<String, String> fileAndLine = machine.getFileAndLine(); final int start = machine.getStart(); final String lineNumber = fileAndLine.second; // Cut too long lines that can't be presented as integer anyway final int number = Integer.parseInt((lineNumber.length() > 5 ? lineNumber.substring(0, 5) : lineNumber)); return new LinkInTrace(fileAndLine.first, number, start, start + fileAndLine.first.length() + lineNumber.length() + 1); }