use of org.stepik.core.serialization.StudyUnrecognizedFormatException in project intellij-plugins by StepicOrg.
the class StepikProjectManager method loadState.
@Override
public void loadState(Element state) {
try {
logger.info("Start load the StepikProjectManager state");
int version = StudySerializationUtils.getVersion(state);
switch(version) {
case 1:
state = StudySerializationUtils.convertToSecondVersion(state);
case 2:
state = StudySerializationUtils.convertToThirdVersion(state);
case 3:
state = StudySerializationUtils.convertToFourthVersion(state);
}
String xml = elementToXml(state);
XStream xs = getXStream();
xs.fromXML(xml, this);
this.version = CURRENT_VERSION;
refreshCourse();
updateSelection();
logger.info("The StepikProjectManager state loaded");
} catch (XStreamException | StudyUnrecognizedFormatException e) {
logger.warn("Failed deserialization StepikProjectManager \n" + e.getMessage() + "\n" + project);
}
}
Aggregations