void (Project project, List<? extends MavenProject> mavenProjects) { ActionManager actionManager = ActionManager.getInstance(); MavenShortcutsManager shortcutsManager = MavenShortcutsManager.getInstance(project); var actionManagerActionsExist = !actionManager.getActionIdList(MavenShortcutsManager.ACTION_ID_PREFIX).isEmpty(); var shortcutsManagerActionsExist = shortcutsManager.hasShortcuts(); if (!actionManagerActionsExist && !shortcutsManagerActionsExist) return; for (MavenProject eachProject : mavenProjects) { //noinspection TestOnlyProblems String actionIdPrefix = getActionPrefix(project, eachProject); if (actionIdPrefix == null) continue; for (MavenGoalAction eachAction : collectActions(eachProject)) { String id = actionIdPrefix + eachAction.getGoal(); if(shortcutsManager.hasShortcuts(eachProject, eachAction.getGoal())) { actionManager.replaceAction(id, eachAction); } else { actionManager.unregisterAction(id); } } } }