java: missed case handled; diagnostic added
authorRoman Shevchenko <roman.shevchenko@jetbrains.com>
Fri, 26 Jun 2015 13:22:38 +0000 (16:22 +0300)
committerRoman Shevchenko <roman.shevchenko@jetbrains.com>
Fri, 26 Jun 2015 13:25:48 +0000 (16:25 +0300)
java/java-psi-impl/src/com/intellij/psi/impl/source/PsiJavaCodeReferenceElementImpl.java

index 1a859c709da0d4918030e68aa4a05739d7c31e7f..573cf8f542b391a10009d8d4de4aeda29e06ca67 100644 (file)
@@ -623,11 +623,13 @@ public class PsiJavaCodeReferenceElementImpl extends CompositePsiElement impleme
   }
 
   private boolean isFullyQualified(@NotNull PsiFile containingFile) {
-    switch (getKind(containingFile)) {
+    int kind = getKind(containingFile);
+    switch (kind) {
       case CLASS_OR_PACKAGE_NAME_KIND:
         if (resolve() instanceof PsiPackage) return true;
         break;
       case CLASS_NAME_KIND:
+      case CLASS_IN_QUALIFIED_NEW_KIND:
         break;
 
       case PACKAGE_NAME_KIND:
@@ -636,15 +638,15 @@ public class PsiJavaCodeReferenceElementImpl extends CompositePsiElement impleme
         return true;
 
       default:
-        LOG.assertTrue(false);
+        LOG.error(kind);
         return true;
     }
 
-    final ASTNode qualifier = findChildByRole(ChildRole.QUALIFIER);
+    ASTNode qualifier = findChildByRole(ChildRole.QUALIFIER);
     if (qualifier == null) return false;
 
     LOG.assertTrue(qualifier.getElementType() == JavaElementType.JAVA_CODE_REFERENCE);
-    final PsiElement refElement = SourceTreeToPsiMap.<PsiJavaCodeReferenceElement>treeToPsiNotNull(qualifier).resolve();
+    PsiElement refElement = SourceTreeToPsiMap.<PsiJavaCodeReferenceElement>treeToPsiNotNull(qualifier).resolve();
     if (refElement instanceof PsiPackage) return true;
 
     return SourceTreeToPsiMap.<PsiJavaCodeReferenceElementImpl>treeToPsiNotNull(qualifier).isFullyQualified(containingFile);