java: ClsFile.findElementAt() behaviour fixed
authorRoman Shevchenko <roman.shevchenko@jetbrains.com>
Thu, 30 Oct 2014 13:28:06 +0000 (14:28 +0100)
committerRoman Shevchenko <roman.shevchenko@jetbrains.com>
Thu, 30 Oct 2014 13:28:06 +0000 (14:28 +0100)
java/java-tests/testSrc/com/intellij/psi/ClsMirrorBuildingTest.java

index a7c2c093576b4141b0d8819cabe452bba0337b3c..df5cb1d2ff49860b61008ff851d8f24b7d78b8fc 100644 (file)
@@ -25,6 +25,7 @@ import com.intellij.openapi.vfs.StandardFileSystems;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
 import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
+import com.intellij.psi.impl.compiled.ClsElementImpl;
 import com.intellij.psi.impl.compiled.ClsFileImpl;
 import com.intellij.psi.impl.compiled.InnerClassSourceStrategy;
 import com.intellij.psi.impl.compiled.StubBuildingVisitor;
@@ -148,7 +149,7 @@ public class ClsMirrorBuildingTest extends LightIdeaTestCase {
     assertNotNull(path, psiFile);
     for (int i = 0; i < psiFile.getTextLength(); i++) {
       PsiElement element = psiFile.findElementAt(i);
-      assertFalse(i + ":" + element, element instanceof PsiFile);
+      assertTrue(i + ":" + element, element == null || element instanceof ClsElementImpl && !(element instanceof PsiFile));
     }
   }