boolean (final ValidationListener listener) { final Set<String> checkSet = new HashSet<>(); final AmbiguousPatternsFinder ambiguousPatternsFinder = new AmbiguousPatternsFinder(); for (int i = 0; i < myRoot.getChildCount(); i++) { final MyNode node = (MyNode) myRoot.getChildAt(i); final GroupConfigurable groupConfigurable = (GroupConfigurable) node.getConfigurable(); final String groupName = groupConfigurable.getEditableObject().getName(); if (checkSet.contains(groupName)) { listener.onError(message("dialog.edit.http.proxies.settings.error.same.group.names.text", groupName), myComponent, true); return false; } checkSet.add(groupName); } for (int i = 0; i < myRoot.getChildCount(); i++) { final MyNode node = (MyNode)myRoot.getChildAt(i); final GroupConfigurable groupConfigurable = (GroupConfigurable)node.getConfigurable(); groupConfigurable.applyImpl(); String error = groupConfigurable.validate(); if (error != null) { listener.onError(error, myComponent, false); return false; } if (!groupConfigurable.getEditableObject().isDefault()) { final String groupName = groupConfigurable.getEditableObject().getName(); final List<String> urls = groupConfigurable.getRepositories(); ambiguousPatternsFinder.acceptUrls(groupName, urls); } } String error = ambiguousPatternsFinder.validate(); if (error != null) { listener.onError(error, myComponent, false); return false; } return true; }