void () { final Set<String> names = new HashSet<>(); final ListModel<AntInstallation> model = myForm.getAntsList().getModel(); for (int idx = 0; idx < model.getSize(); idx++) { final AntInstallation inst = model.getElementAt(idx); @NlsSafe final String name = AntInstallation.NAME.get(myForm.getProperties(inst)); if (names.contains(name)) { Messages.showErrorDialog(AntBundle.message("dialog.message.duplicate.ant.installation.name", name), getTitle()); return; } names.add(name); } super.doOKAction(); }