@@ -33,6 +33,7 @@ import org.jetbrains.annotations.NonNls
3333import org.jetbrains.annotations.TestOnly
3434import java.lang.ref.Reference
3535import java.lang.ref.WeakReference
36+ import java.util.Objects
3637import java.util.concurrent.Callable
3738import java.util.concurrent.TimeUnit
3839import java.util.concurrent.TimeoutException
@@ -121,12 +122,10 @@ class DocumentCommitThread : DocumentCommitProcessor, Disposable {
121122 // todo IJPL-339 check if this is correct
122123 for (psiFile in viewProvider.getAllFiles()) {
123124 val oldFileNode = psiFile.getNode()
124- if (oldFileNode == null ) {
125- throw AssertionError (" No node for " + psiFile.javaClass + " in " + psiFile.getViewProvider().javaClass +
126- " of size " + StringUtil .formatFileSize(document.textLength.toLong()) +
127- " (is too large = " + SingleRootFileViewProvider
128- .isTooLargeForIntelligence(viewProvider.getVirtualFile(), document.textLength.toLong()) + " )" )
129- }
125+ ? : throw AssertionError (" No node for " + psiFile.javaClass + " in " + psiFile.getViewProvider().javaClass +
126+ " of size " + StringUtil .formatFileSize(document.textLength.toLong()) +
127+ " (is too large = " + SingleRootFileViewProvider
128+ .isTooLargeForIntelligence(viewProvider.getVirtualFile(), document.textLength.toLong()) + " )" )
130129 val changedPsiRange = ChangedPsiRangeUtil .getChangedPsiRange(
131130 psiFile,
132131 document,
@@ -225,7 +224,10 @@ class DocumentCommitThread : DocumentCommitProcessor, Disposable {
225224 return myDocumentRef.get() == other.myDocumentRef.get() && myProject == other.myProject
226225 }
227226
228- override fun hashCode (): Int = 31 * myLastCommittedText.hashCode() + myProject.hashCode()
227+ override fun hashCode (): Int {
228+ return 31 * Objects .hashCode(myDocumentRef.get()) + myProject.hashCode()
229+ }
230+
229231 // return null if the document is changed or gced
230232 fun stillValidDocument (): Document ? {
231233 val document = myDocumentRef.get()
0 commit comments