void (@NotNull Element element, @NotNull List<TodoPattern> patterns) { myName = element.getAttributeValue(ATTRIBUTE_NAME); if (myName == null) { throw new IllegalArgumentException(); } myTodoPatterns.clear(); for (Element child : element.getChildren(ELEMENT_PATTERN)) { try { int index = Integer.parseInt(child.getAttributeValue(ATTRIBUTE_INDEX)); if (index < 0 || index > patterns.size() - 1) { continue; } TodoPattern pattern = patterns.get(index); if (myTodoPatterns.contains(pattern)) { continue; } myTodoPatterns.add(pattern); } catch (NumberFormatException ignored) { } } }