better context for IDEA-132876 Compiling evaluator does not work if stopped on method...
authorEgor.Ushakov <egor.ushakov@jetbrains.com>
Thu, 30 Apr 2015 17:36:39 +0000 (20:36 +0300)
committerEgor.Ushakov <egor.ushakov@jetbrains.com>
Thu, 30 Apr 2015 17:51:07 +0000 (20:51 +0300)
java/debugger/impl/src/com/intellij/debugger/engine/PositionManagerImpl.java

index 209be7d5c9a453ed72b63421630ae9d04c5a279f..4e9b273a0c035dd9ebe0c2b84427155b27552d89 100644 (file)
@@ -281,10 +281,13 @@ public class PositionManagerImpl implements PositionManager, MultiRequestPositio
           @Override
           public PsiElement next() {
             PsiElement res = myElement;
-            myElement = PsiTreeUtil.nextLeaf(myElement);
-            if (myElement != null && myElement.getTextOffset() > endOffset) {
-              myElement = null;
-            }
+            do {
+              myElement = PsiTreeUtil.nextLeaf(myElement);
+              if (myElement == null || myElement.getTextOffset() > endOffset) {
+                myElement = null;
+                break;
+              }
+            } while (myElement.getTextLength() == 0);
             return res;
           }