void (@NotNull Project project, @Nullable String targetName) { List<String> targetMavenHomes = findTargetMavenHomes(project, targetName); if (!mavenHomeField.getHistory().equals(targetMavenHomes)) { EdtInvocationManager.getInstance().invokeLater(() -> mavenHomeField.setHistory(targetMavenHomes)); } String mavenHomeFieldText = mavenHomeField.getText(); if (targetMavenHomes.isEmpty()) { if (!mavenHomeFieldText.isEmpty()) { EdtInvocationManager.getInstance().invokeLater(() -> mavenHomeField.setSelectedItem("")); } } else if (!targetMavenHomes.contains(mavenHomeFieldText)) { EdtInvocationManager.getInstance().invokeLater(() -> { if (!targetMavenHomes.contains(mavenHomeField.getText())) { mavenHomeField.setSelectedItem(targetMavenHomes.get(0)); } }); } }