ProjectJdkTableImpl: save to disk only serializable SDKs, do not touch MockSdk used in tests

In new project model all SDKs must be registered in SDK table to properly resolve them, so MockSdks are now registered in ProjectJdkTable, which causes errors on occasional serialization in tests

GitOrigin-RevId: 9d200a0446581e89f96b01206ed8d844425c3121
This commit is contained in:
Leonid Shalupov
2019-08-02 21:02:32 +03:00
committed by intellij-monorepo-bot
parent 33483e480f
commit 5ab99cafde
@@ -249,9 +249,11 @@ public class ProjectJdkTableImpl extends ProjectJdkTable implements ExportableCo
public Element getState() {
Element element = new Element("state");
for (Sdk jdk : mySdks) {
Element e = new Element(ELEMENT_JDK);
((ProjectJdkImpl)jdk).writeExternal(e);
element.addContent(e);
if (jdk instanceof ProjectJdkImpl) {
Element e = new Element(ELEMENT_JDK);
((ProjectJdkImpl)jdk).writeExternal(e);
element.addContent(e);
}
}
return element;
}