diff --git a/java/java-impl/src/com/intellij/codeInsight/editorActions/smartEnter/PlainEnterProcessor.java b/java/java-impl/src/com/intellij/codeInsight/editorActions/smartEnter/PlainEnterProcessor.java index 1f78ab31c3ea..8701b9872595 100644 --- a/java/java-impl/src/com/intellij/codeInsight/editorActions/smartEnter/PlainEnterProcessor.java +++ b/java/java-impl/src/com/intellij/codeInsight/editorActions/smartEnter/PlainEnterProcessor.java @@ -147,8 +147,7 @@ public class PlainEnterProcessor implements EnterProcessor { int i = CharArrayUtil.shiftForward(whiteSpaceText, 0, " \t"); if (i >= whiteSpaceText.length() - 1) { - assert false : String.format("document: '%s', code block: %s, white space: %s", - document.getText(), codeBlock.getTextRange(), whiteSpace.getTextRange()); + assert false : String.format("code block: %s, white space: %s", codeBlock.getTextRange(), whiteSpace.getTextRange()); return false; } diff --git a/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/ImportsFormatter.java b/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/ImportsFormatter.java index c18fb77fb34c..06a48f3948a9 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/ImportsFormatter.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/codeStyle/ImportsFormatter.java @@ -106,7 +106,7 @@ public class ImportsFormatter extends XmlRecursiveElementVisitor { final StringBuffer result = new StringBuffer(); final int lineStartOffset = myDocumentModel.getLineStartOffset(myDocumentModel.getLineNumber(startOffset)); - final int emptyLineEnd = CharArrayUtil.shiftForward(myDocumentModel.getDocument().getText(), lineStartOffset, " \t"); + final int emptyLineEnd = CharArrayUtil.shiftForward(myDocumentModel.getDocument().getCharsSequence(), lineStartOffset, " \t"); final CharSequence spaces = myDocumentModel.getText(new TextRange(lineStartOffset, emptyLineEnd)); if (spaces != null) { diff --git a/platform/lang-impl/src/com/intellij/application/options/ChangesDiffCalculator.java b/platform/lang-impl/src/com/intellij/application/options/ChangesDiffCalculator.java index b74045c45f7a..e0f0f4008ed9 100644 --- a/platform/lang-impl/src/com/intellij/application/options/ChangesDiffCalculator.java +++ b/platform/lang-impl/src/com/intellij/application/options/ChangesDiffCalculator.java @@ -56,7 +56,7 @@ public class ChangesDiffCalculator { myOldMarkup.document = beforeDocument; myNewMarkup.document = currentDocument; - List lineFragments = null; + List lineFragments; try { lineFragments = myCompareProcessor.process(beforeDocument.getText(), currentDocument.getText()); } diff --git a/platform/lang-impl/src/com/intellij/formatting/AbstractBlockAlignmentProcessor.java b/platform/lang-impl/src/com/intellij/formatting/AbstractBlockAlignmentProcessor.java index 70499b7bf055..b77c88b16c8c 100644 --- a/platform/lang-impl/src/com/intellij/formatting/AbstractBlockAlignmentProcessor.java +++ b/platform/lang-impl/src/com/intellij/formatting/AbstractBlockAlignmentProcessor.java @@ -87,8 +87,8 @@ public abstract class AbstractBlockAlignmentProcessor implements BlockAlignmentP if (blocksCausedRealignment != null && blocksCausedRealignment.contains(context.targetBlock)) { LOG.error(String.format("Formatting error - code block %s is set to be shifted right because of its alignment with " + "block %s more than once. I.e. moving the former block because of alignment algorithm causes " - + "subsequent block to be shifted right as well - cyclic dependency. Document: %n%s", - offsetResponsibleBlock.getTextRange(), context.targetBlock.getTextRange(), context.document.getText() + + "subsequent block to be shifted right as well - cyclic dependency", + offsetResponsibleBlock.getTextRange(), context.targetBlock.getTextRange() )); blocksCausedRealignment.add(context.targetBlock); return Result.UNABLE_TO_ALIGN_BACKWARD_BLOCK; diff --git a/platform/lang-impl/src/com/intellij/psi/formatter/FormattingDocumentModelImpl.java b/platform/lang-impl/src/com/intellij/psi/formatter/FormattingDocumentModelImpl.java index bf566d747da9..e02100d206c0 100644 --- a/platform/lang-impl/src/com/intellij/psi/formatter/FormattingDocumentModelImpl.java +++ b/platform/lang-impl/src/com/intellij/psi/formatter/FormattingDocumentModelImpl.java @@ -60,8 +60,7 @@ public class FormattingDocumentModelImpl implements FormattingDocumentModel { LOG.error("Document is uncommitted"); } if (!document.getText().equals(file.getText())) { - LOG.error( - "Document and psi file texts should be equal : \nDocument text:\n" + document.getText() + "\nFile text:\n" + file.getText()); + LOG.error("Document and psi file texts should be equal"); } return new FormattingDocumentModelImpl(document, file); } diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/ex/util/EditorUtil.java b/platform/platform-impl/src/com/intellij/openapi/editor/ex/util/EditorUtil.java index 756e4c3df1e7..ace9e5b1f6e7 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/ex/util/EditorUtil.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/ex/util/EditorUtil.java @@ -129,9 +129,9 @@ public class EditorUtil { assert false : String.format( "Target visual line: %d, mapped logical line: %d, visual lines range for the mapped logical line: [%s]-[%s], soft wraps for " - + "the target logical line: %s, all soft wraps: %s, fold regions: %s%nDocument text: '%s'", + + "the target logical line: %s, all soft wraps: %s, fold regions: %s", line, resultLogLine, resVisStart, resVisEnd, softWraps, editor.getSoftWrapModel().getSoftWrapsForRange(0, document.getTextLength()), - Arrays.toString(editor.getFoldingModel().getAllFoldRegions()), editor.getDocument().getText() + Arrays.toString(editor.getFoldingModel().getAllFoldRegions()) ); return resVisEnd.column; } diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretModelImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretModelImpl.java index 3e21341964b1..3a2108139a7b 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretModelImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretModelImpl.java @@ -186,8 +186,7 @@ public class CaretModelImpl implements CaretModel, PrioritizedDocumentListener, if (!ignoreWrongMoves && !myEditor.offsetToLogicalPosition(myOffset).equals(myEditor.offsetToLogicalPosition(offset))) { LOG.error( "caret moved to wrong offset. Requested:" + offset + " but actual:" + myOffset - + ". Soft wraps data: " + myEditor.getSoftWrapModel() + ", folding data: " + myEditor.getFoldingModel() - + ", document:\n" + myEditor.getDocument().getText()); + + ". Soft wraps data: " + myEditor.getSoftWrapModel() + ", folding data: " + myEditor.getFoldingModel()); } } diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/SoftWrapModelImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/SoftWrapModelImpl.java index 1be601cf4231..2a0f5872264b 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/SoftWrapModelImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/SoftWrapModelImpl.java @@ -616,8 +616,9 @@ public class SoftWrapModelImpl implements SoftWrapModelEx, PrioritizedDocumentLi if (Boolean.getBoolean(DEBUG_PROPERTY_NAME)) { LOG.error(String.format( "Unexpected exception occurred during performing '%s'. Current soft wraps cache: %n" - + "%s%nDocument:%n%s%nFold regions: %s", - task, myDataMapper, myEditor.getDocument().getText(), Arrays.toString(myEditor.getFoldingModel().fetchTopLevel())), e); + + "%s%nFold regions: %s", + task, myDataMapper, Arrays.toString(myEditor.getFoldingModel().fetchTopLevel())), e + ); } myEditor.getFoldingModel().rebuild(); myDataMapper.release();