mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
vcs: remove dead code
`createFilePathOn` can't return `null`
This commit is contained in:
+2
-9
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user