From 6f94942cffbc1fdd3977d8fecde8bd82cdb60ea2 Mon Sep 17 00:00:00 2001 From: Alexander Zolotov Date: Thu, 30 Jan 2014 20:24:52 +0400 Subject: [PATCH] Add diagnostic attachments for commit document assertion simplify logging --- .../psi/impl/DocumentCommitProcessor.java | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/platform/core-impl/src/com/intellij/psi/impl/DocumentCommitProcessor.java b/platform/core-impl/src/com/intellij/psi/impl/DocumentCommitProcessor.java index 6c6c9f67b5c6..8e54370a8195 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/DocumentCommitProcessor.java +++ b/platform/core-impl/src/com/intellij/psi/impl/DocumentCommitProcessor.java @@ -194,20 +194,13 @@ public abstract class DocumentCommitProcessor { if (myTreeElementBeingReparsedSoItWontBeCollected.getTextLength() != document.getTextLength()) { final String documentText = document.getText(); String fileText = file.getText(); - if (ApplicationManager.getApplication().isInternal()) { - LOG.error("commitDocument left PSI inconsistent; file len=" + myTreeElementBeingReparsedSoItWontBeCollected.getTextLength() + - "; doc len=" + document.getTextLength() + - "; doc.getText() == file.getText(): " + Comparing.equal(fileText, documentText) + - ";\n file psi text=" + fileText + - ";\n doc text=" + documentText + - ";\n old psi file text=" + oldPsiText); - } - else { - LOG.error("commitDocument left PSI inconsistent: " + file, - new Attachment("file psi text", fileText), - new Attachment("old text", documentText), - new Attachment("old psi file text", oldPsiText)); - } + LOG.error("commitDocument left PSI inconsistent: " + file + + "; file len=" + myTreeElementBeingReparsedSoItWontBeCollected.getTextLength() + + "; doc len=" + document.getTextLength() + + "; doc.getText() == file.getText(): " + Comparing.equal(fileText, documentText), + new Attachment("file psi text", fileText), + new Attachment("old text", documentText), + new Attachment("old psi file text", oldPsiText)); file.putUserData(BlockSupport.DO_NOT_REPARSE_INCREMENTALLY, Boolean.TRUE); try {