mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[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:
+11
-3
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user