vcs: remove dead code

`createFilePathOn` can't return `null`
This commit is contained in:
Aleksey Pivovarov
2017-04-19 16:11:45 +03:00
parent f47057bc42
commit 99f603ffe6
2 changed files with 4 additions and 13 deletions
@@ -85,12 +85,7 @@ class ChangeListManagerSerialization {
//noinspection unchecked
final List<Element> changeNodes = listNode.getChildren(NODE_CHANGE);
for (Element changeNode : changeNodes) {
try {
myWorker.addChangeToList(changeListName, readChange(changeNode), null);
}
catch (OutdatedFakeRevisionException e) {
// Do nothing. Just skip adding outdated revisions to the list.
}
myWorker.addChangeToList(changeListName, readChange(changeNode), null);
}
if (ATT_VALUE_TRUE.equals(listNode.getAttributeValue(ATT_DEFAULT))) {
@@ -176,11 +171,9 @@ class ChangeListManagerSerialization {
changeNode.setAttribute(ATT_CHANGE_AFTER_PATH, aRev != null ? aRev.getFile().getPath() : "");
}
private static Change readChange(Element changeNode) throws OutdatedFakeRevisionException {
private static Change readChange(Element changeNode) {
String bRev = changeNode.getAttributeValue(ATT_CHANGE_BEFORE_PATH);
String aRev = changeNode.getAttributeValue(ATT_CHANGE_AFTER_PATH);
return new Change(StringUtil.isEmpty(bRev) ? null : new FakeRevision(bRev), StringUtil.isEmpty(aRev) ? null : new FakeRevision(aRev));
}
static final class OutdatedFakeRevisionException extends Exception {}
}
@@ -26,10 +26,8 @@ import java.io.File;
public class FakeRevision implements ContentRevision {
private final FilePath myFile;
public FakeRevision(String path) throws ChangeListManagerSerialization.OutdatedFakeRevisionException {
final FilePath file = VcsContextFactory.SERVICE.getInstance().createFilePathOn(new File(path));
if (file == null) throw new ChangeListManagerSerialization.OutdatedFakeRevisionException();
myFile = file;
public FakeRevision(String path) {
myFile = VcsContextFactory.SERVICE.getInstance().createFilePathOn(new File(path));
}
@Nullable