void (Project project) { final Collection<ExternalProjectInfo> projectsData = ProjectDataManager.getInstance().getExternalProjectsData(project, GradleConstants.SYSTEM_ID); for (ExternalProjectInfo projectInfo : projectsData) { DataNode<ProjectData> projectDataNode = projectInfo.getExternalProjectStructure(); if (projectDataNode == null) continue; 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); } } }