[Shelf]: (IDEA-144946, EA-72761) Exceptions from shelf after project move to another folder

* store all paths in system independent way and force convert if needed
This commit is contained in:
Nadya Zabrodina
2015-09-15 15:28:48 +03:00
parent 358b39ebae
commit 8673d7ee50
2 changed files with 12 additions and 3 deletions
@@ -50,9 +50,10 @@ public class ShelvedBinaryFile implements JDOMExternalizable {
public ShelvedBinaryFile(final String beforePath, final String afterPath, @Nullable final String shelvedPath) {
assert beforePath != null || afterPath != null;
BEFORE_PATH = convertToSystemIndependent(beforePath);
AFTER_PATH = convertToSystemIndependent(afterPath);
SHELVED_PATH = convertToSystemIndependent(shelvedPath);
BEFORE_PATH = beforePath;
AFTER_PATH = afterPath;
SHELVED_PATH = shelvedPath;
convertPathsToSystemIndependent();
}
@Nullable
@@ -60,8 +61,15 @@ public class ShelvedBinaryFile implements JDOMExternalizable {
return beforePath != null ? FileUtil.toSystemIndependentName(beforePath) : null;
}
private void convertPathsToSystemIndependent() {
BEFORE_PATH = convertToSystemIndependent(BEFORE_PATH);
AFTER_PATH = convertToSystemIndependent(AFTER_PATH);
SHELVED_PATH = convertToSystemIndependent(SHELVED_PATH);
}
public void readExternal(Element element) throws InvalidDataException {
DefaultJDOMExternalizer.readExternal(this, element);
convertPathsToSystemIndependent();
}
public void writeExternal(Element element) throws WriteExternalException {
@@ -84,6 +84,7 @@ public class ShelvedChangeList implements JDOMExternalizable, ExternalizableSche
@Override
public void readExternal(Element element) throws InvalidDataException {
DefaultJDOMExternalizer.readExternal(this, element);
PATH = FileUtil.toSystemIndependentName(PATH);
mySchemeName = element.getAttributeValue(NAME_ATTRIBUTE);
DATE = new Date(Long.parseLong(element.getAttributeValue(ATTRIBUTE_DATE)));
myRecycled = Boolean.parseBoolean(element.getAttributeValue(ATTRIBUTE_RECYCLED_CHANGELIST));