platform: more correct cancellation check; condition simplified
authorRoman Shevchenko <roman.shevchenko@jetbrains.com>
Fri, 6 Feb 2015 15:59:16 +0000 (16:59 +0100)
committerRoman Shevchenko <roman.shevchenko@jetbrains.com>
Fri, 6 Feb 2015 16:02:13 +0000 (17:02 +0100)
platform/core-impl/src/com/intellij/lang/impl/PsiBuilderImpl.java

index da2212ccd5e0b6550d2ce1002d66139a4a80bb28..c984f56575fd40f411a2c527d918e9f36a5bfe11 100644 (file)
@@ -763,14 +763,16 @@ public class PsiBuilderImpl extends UserDataHolderBase implements PsiBuilder {
 
   @Override
   public void advanceLexer() {
+    ProgressIndicatorProvider.checkCanceled();
+
     if (eof()) return;
 
     if (!myTokenTypeChecked) {
-      LOG.assertTrue(eof(), "Probably a bug: eating token without its type checking");
+      LOG.error("Probably a bug: eating token without its type checking");
     }
+
     myTokenTypeChecked = false;
     myCurrentLexeme++;
-    ProgressIndicatorProvider.checkCanceled();
     clearCachedTokenType();
   }