don't assert EDT for non-awt documents (https://github.com/JetBrains/intellij-communi...
authorpeter <peter@jetbrains.com>
Mon, 2 Feb 2015 15:06:27 +0000 (16:06 +0100)
committerpeter <peter@jetbrains.com>
Mon, 2 Feb 2015 15:14:55 +0000 (16:14 +0100)
platform/core-impl/src/com/intellij/openapi/editor/impl/DocumentImpl.java

index d380056e8a47b33ebea35b65625327a8e0b6fe2b..5543c430f361afb71a498e2ec70f8846a36063cb 100644 (file)
@@ -1022,7 +1022,9 @@ public class DocumentImpl extends UserDataHolderBase implements DocumentEx {
 
   @Override
   public final void setInBulkUpdate(boolean value) {
-    ApplicationManager.getApplication().assertIsDispatchThread();
+    if (myAssertThreading) {
+      ApplicationManager.getApplication().assertIsDispatchThread();
+    }
     if (myDoingBulkUpdate == value) {
       // do not fire listeners or otherwise updateStarted() will be called more times than updateFinished()
       return;
@@ -1084,7 +1086,9 @@ public class DocumentImpl extends UserDataHolderBase implements DocumentEx {
   }
 
   void requestTabTracking() {
-    ApplicationManager.getApplication().assertIsDispatchThread();
+    if (myAssertThreading) {
+      ApplicationManager.getApplication().assertIsDispatchThread();
+    }
     if (myTabTrackingRequestors++ == 0) {
       myMightContainTabs = false;
       updateMightContainTabs(myText);
@@ -1092,7 +1096,9 @@ public class DocumentImpl extends UserDataHolderBase implements DocumentEx {
   }
 
   void giveUpTabTracking() {
-    ApplicationManager.getApplication().assertIsDispatchThread();
+    if (myAssertThreading) {
+      ApplicationManager.getApplication().assertIsDispatchThread();
+    }
     if (--myTabTrackingRequestors == 0) {
       myMightContainTabs = true;
     }