private static void reportInconsistentLength(PsiFile file, CharSequence newFileText, ASTNode node, int start, int end) {
    @NonNls String message = "Index out of bounds: type=" + node.getElementType() +
                             "; file=" + file +
                             "; file.class=" + file.getClass() +
                             "; start=" + start +
                             "; end=" + end +
                             "; length=" + node.getTextLength();
    String newTextBefore = newFileText.subSequence(0, start).toString();
    String oldTextBefore = file.getText().subSequence(0, start).toString();
    if (oldTextBefore.equals(newTextBefore)) {
      message += "; oldTextBefore==newTextBefore";
    }
    LOG.error(message,
              new Attachment(file.getName() + "_oldNodeText.txt", node.getText()),
              new Attachment(file.getName() + "_oldFileText.txt", file.getText()),
              new Attachment(file.getName() + "_newFileText.txt", newFileText.toString())
    );
  }
private static void reportInconsistentLength(PsiFile file, CharSequence newFileText, ASTNode node, int start, int end)