protected int calcLine() {
      final PsiFile file = getFile();
      Document document = null;
      try {
        document = getDocument(file);
        if (document == null) { // may be decompiled psi - try to get document for the original file
          document = getDocument(file.getOriginalFile());
        }
      }
      catch (ProcessCanceledException ignored) {
      }
      catch (Throwable e) {
        LOG.error(e);
      }
      if (document != null) {
        try {
          return document.getLineNumber(calcOffset());
        }
        catch (IndexOutOfBoundsException e) {
          // may happen if document has been changed since the this SourcePosition was created
        }
      }
      return -1;
    }
protected int calcLine()