diagnostics for http://ea.jetbrains.com/browser/ea_problems/16883
authorDmitry Avdeev <Dmitry.Avdeev@jetbrains.com>
Thu, 1 Apr 2010 08:47:39 +0000 (12:47 +0400)
committerDmitry Avdeev <Dmitry.Avdeev@jetbrains.com>
Thu, 1 Apr 2010 08:47:39 +0000 (12:47 +0400)
platform/lang-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/FileReference.java

index df03bb66ab630fe157a9fd7ebdd869093903ae8a..bad72948b7e0369cb2867742e5fe139a57452ac1 100644 (file)
@@ -418,8 +418,12 @@ public class FileReference implements FileReferenceOwner, PsiPolyVariantReferenc
             break;
           }
       }
-      checkNotNull(curItem, curVFile, dstVFile);
-      assert curItem != null;
+      if (curItem == null) {
+        throw new IncorrectOperationException("Cannot find path between files; " +
+                                              "src = " + curVFile.getPresentableUrl() + "; " +
+                                              "dst = " + dstVFile.getPresentableUrl() + "; " +
+        "Contexts: " + contexts);
+      }
       if (curItem.equals(dstItem)) {
         if (getCanonicalText().equals(dstItem.getName())) {
           return getElement();
@@ -453,12 +457,6 @@ public class FileReference implements FileReferenceOwner, PsiPolyVariantReferenc
     return manipulator.handleContentChange(getElement(), range, newName);
   }
 
-  private static void checkNotNull(final Object o, final VirtualFile curVFile, final VirtualFile dstVFile) throws IncorrectOperationException {
-    if (o == null) {
-      throw new IncorrectOperationException("Cannot find path between files; src = " + curVFile.getPresentableUrl() + "; dst = " + dstVFile.getPresentableUrl());
-    }
-  }
-
   public void registerQuickfix(HighlightInfo info, FileReference reference) {
     for (final FileReferenceHelper helper : getHelpers()) {
       helper.registerFixes(info, reference);