int (int offset) { if (offset > myDocument.getTextLength()) { LOG.error(String.format("Invalid offset detected (%d). Document length: %d. Target file: %s", offset, myDocument.getTextLength(), myFile)); } return myDocument.getLineNumber(offset); }