This commit is contained in:
Dmitry Avdeev
2010-04-01 12:47:39 +04:00
parent 224d0bc576
commit 88e91e9364
@@ -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);