ValidationInfo (@Nullable String text) { if (text.isBlank()) { return new ValidationInfo(JavaRefactoringBundle.message("migration.edit.empty.name")); } if (myMigrationMapSet.findMigrationMap(text) != null && (myEditedMapName.isEmpty() || !text.equals(myEditedMapName))) { // new map with existing name || edited map with another existing name return new ValidationInfo(JavaRefactoringBundle.message("migration.edit.existing.name")); } return null; }