bind file element even if refused to bind classes
authorMaxim Shafirov <max@jetbrains.com>
Wed, 10 Mar 2010 11:41:23 +0000 (14:41 +0300)
committernik <Nikolay.Chashnikov@jetbrains.com>
Wed, 10 Mar 2010 11:41:23 +0000 (14:41 +0300)
java/java-impl/src/com/intellij/psi/impl/compiled/ClsFileImpl.java

index 360d33225dd1c6cf784392655d2346ddd9879ee6..fd9ae54733c016a5ec9b22f251abc2a1baeae91b 100644 (file)
@@ -225,17 +225,14 @@ public class ClsFileImpl extends ClsRepositoryPsiElement<PsiClassHolderFileStub>
       }
 
       PsiClass[] classes = getClasses();
       }
 
       PsiClass[] classes = getClasses();
-      if (classes.length == 1) {
-        if (!JavaPsiFacade.getInstance(getProject()).getNameHelper().isIdentifier(classes[0].getName())) {
-          return; // Can happen for package-info.class, or classes compiled from languages, that support different class naming scheme, like Scala.
-        }
-      }
-
-      PsiClass[] mirrorClasses = ((PsiJavaFile)mirrorFile).getClasses();
-      LOG.assertTrue(classes.length == mirrorClasses.length);
-      if (classes.length == mirrorClasses.length) {
-        for (int i = 0; i < classes.length; i++) {
-          ((ClsElementImpl)classes[i]).setMirror((TreeElement)SourceTreeToPsiMap.psiElementToTree(mirrorClasses[i]));
+      // Can happen for package-info.class, or classes compiled from languages, that support different class naming scheme, like Scala.
+      if (classes.length != 1 || JavaPsiFacade.getInstance(getProject()).getNameHelper().isIdentifier(classes[0].getName())) {
+        PsiClass[] mirrorClasses = ((PsiJavaFile)mirrorFile).getClasses();
+        LOG.assertTrue(classes.length == mirrorClasses.length);
+        if (classes.length == mirrorClasses.length) {
+          for (int i = 0; i < classes.length; i++) {
+            ((ClsElementImpl)classes[i]).setMirror((TreeElement)SourceTreeToPsiMap.psiElementToTree(mirrorClasses[i]));
+          }
         }
       }
     }
         }
       }
     }