mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Gradle: catch deserialization issue caused by fast serializer EA-140767
This commit is contained in:
+13
-4
@@ -9,6 +9,7 @@ import com.intellij.openapi.externalSystem.model.ProjectKeys;
|
||||
import com.intellij.openapi.externalSystem.model.project.ModuleData;
|
||||
import com.intellij.openapi.externalSystem.model.project.ProjectData;
|
||||
import com.intellij.openapi.externalSystem.service.project.ProjectDataManager;
|
||||
import com.intellij.openapi.externalSystem.service.project.manage.ExternalProjectsManager;
|
||||
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -57,11 +58,19 @@ public class GradleExtensionsSettings {
|
||||
DataNode<ProjectData> projectDataNode = projectInfo.getExternalProjectStructure();
|
||||
if (projectDataNode == null) continue;
|
||||
|
||||
Collection<DataNode<GradleExtensions>> nodes = new SmartList<>();
|
||||
for (DataNode<ModuleData> moduleNode : ExternalSystemApiUtil.findAll(projectDataNode, ProjectKeys.MODULE)) {
|
||||
ContainerUtil.addIfNotNull(nodes, ExternalSystemApiUtil.find(moduleNode, GradleExtensionsDataService.KEY));
|
||||
String projectPath = projectInfo.getExternalProjectPath();
|
||||
try {
|
||||
Collection<DataNode<GradleExtensions>> nodes = new SmartList<>();
|
||||
for (DataNode<ModuleData> moduleNode : ExternalSystemApiUtil.findAll(projectDataNode, ProjectKeys.MODULE)) {
|
||||
ContainerUtil.addIfNotNull(nodes, ExternalSystemApiUtil.find(moduleNode, GradleExtensionsDataService.KEY));
|
||||
}
|
||||
getInstance(project).add(projectPath, nodes);
|
||||
}
|
||||
catch (ClassCastException e) {
|
||||
// catch deserialization issue caused by fast serializer
|
||||
LOG.debug(e);
|
||||
ExternalProjectsManager.getInstance(project).getExternalProjectsWatcher().markDirty(projectPath);
|
||||
}
|
||||
getInstance(project).add(projectInfo.getExternalProjectPath(), nodes);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user