+ ". Recursion path: " + groupsInProcess);
}
LOG.debug("\tadding group: {}", name);
groupsInProcess.add(name);
// skip if this group is already parsed
final Group parsedGroup = new WroModelInspector(model).getGroupByName(name);
if (parsedGroup != null) {
// remove before returning
// this group is parsed, remove from unparsed groups collection
groupsInProcess.remove(name);
return parsedGroup.getResources();
}
final Group group = new Group(name);
final List<Resource> resources = new ArrayList<Resource>();
final NodeList resourceNodeList = element.getChildNodes();
for (int i = 0; i < resourceNodeList.getLength(); i++) {
final Node node = resourceNodeList.item(i);
if (node instanceof Element) {
final Element resourceElement = (Element) node;
parseResource(resourceElement, resources);
}
}
group.setResources(resources);
// this group is parsed, remove from unparsed collection
groupsInProcess.remove(name);
if (!isAbstractGroup) {
// add only non abstract groups
model.addGroup(group);