Program: 145676
Project: 145676
Buggy source:
private HeaderGroupConfig processColumn(Element aTag,int deepness) throws Exception {
  String name=aTag.getAttribute("String_Node_Str");
  String title=aTag.getAttribute("String_Node_Str");
  boolean visible=Utils.getBooleanAttribute(aTag,"String_Node_Str",true);
  boolean enabled=Utils.getBooleanAttribute(aTag,"String_Node_Str",true);
  boolean substitute=Utils.getBooleanAttribute(aTag,"String_Node_Str",false);
  boolean plain=Utils.getBooleanAttribute(aTag,"String_Node_Str",true);
  int width=Utils.getIntegerAttribute(aTag,"String_Node_Str",50);
  Element cellTag=null;
  ModelElementRef modelElement=null;
  Element controlTag=null;
  ModelElementRef columnsDatasource=null;
  ModelElementRef columnsDisplayField=null;
  ModelElementRef cellsDatasource=null;
  Element headerEasFontTag=null;
  Element styleTag=null;
  int childrenCount=0;
  int subgroupsCount=0;
  List<HeaderGroupConfig> subGroups=new ArrayList();
  NodeList columnNodes=aTag.getChildNodes();
  for (int c=0; c < columnNodes.getLength(); c++) {
    if ("String_Node_Str".equalsIgnoreCase(columnNodes.item(c).getNodeName()))     cellTag=(Element)columnNodes.item(c);
 else     if ("String_Node_Str".equalsIgnoreCase(columnNodes.item(c).getNodeName()))     modelElement=new ModelElementRef((Element)columnNodes.item(c),model);
 else     if ("String_Node_Str".equalsIgnoreCase(columnNodes.item(c).getNodeName()))     controlTag=(Element)columnNodes.item(c);
 else     if ("String_Node_Str".equalsIgnoreCase(columnNodes.item(c).getNodeName()))     columnsDatasource=new ModelElementRef((Element)columnNodes.item(c),model);
 else     if ("String_Node_Str".equalsIgnoreCase(columnNodes.item(c).getNodeName()))     columnsDisplayField=new ModelElementRef((Element)columnNodes.item(c),model);
 else     if ("String_Node_Str".equalsIgnoreCase(columnNodes.item(c).getNodeName()))     cellsDatasource=new ModelElementRef((Element)columnNodes.item(c),model);
 else     if ("String_Node_Str".equalsIgnoreCase(columnNodes.item(c).getNodeName()))     headerEasFontTag=(Element)columnNodes.item(c);
 else     if ("String_Node_Str".equalsIgnoreCase(columnNodes.item(c).getNodeName()))     styleTag=(Element)columnNodes.item(c);
 else     if ("String_Node_Str".equalsIgnoreCase(columnNodes.item(c).getNodeName())) {
      childrenCount++;
      HeaderGroupConfig subGroup=processColumn((Element)columnNodes.item(c),deepness + 1);
      subGroups.add(subGroup);
      if (subGroup == null) {
        if (childrenCount == 1) {
          currentLeavesCount=leaves.size();
        }
      }
 else       subgroupsCount++;
    }
  }
  if (childrenCount > 0) {
    HeaderGroupConfig group=new HeaderGroupConfig((title != null && !title.isEmpty()) ? title : name);
    groups.add(group);
    group.setRow(deepness);
    if (subgroupsCount > 0)     group.setColumn(subGroups.get(0).getColumn());
 else     group.setColumn(currentLeavesCount - 1);
    group.setRowspan(1);
    int colSpan=0;
    for (    HeaderGroupConfig subGroup : subGroups) {
      if (subGroup == null)       colSpan++;
 else       colSpan+=subGroup.getColspan();
    }
    group.setColspan(colSpan);
    return group;
  }
 else {
    ColumnConfig<Row,?> cc=configureColumn(name,title,width,modelElement,aTag,controlTag);
    if (cc != null) {
      cc.setHidden(!visible);
    }
    return null;
  }
}

Fixed version (ground truth):
private HeaderGroupConfig processColumn(Element aTag,int deepness) throws Exception {
  String name=aTag.getAttribute("String_Node_Str");
  String title=aTag.getAttribute("String_Node_Str");
  boolean visible=Utils.getBooleanAttribute(aTag,"String_Node_Str",true);
  boolean enabled=Utils.getBooleanAttribute(aTag,"String_Node_Str",true);
  boolean substitute=Utils.getBooleanAttribute(aTag,"String_Node_Str",false);
  boolean plain=Utils.getBooleanAttribute(aTag,"String_Node_Str",true);
  int width=Utils.getIntegerAttribute(aTag,"String_Node_Str",50);
  Element cellTag=null;
  ModelElementRef modelElement=null;
  Element controlTag=null;
  ModelElementRef columnsDatasource=null;
  ModelElementRef columnsDisplayField=null;
  ModelElementRef cellsDatasource=null;
  Element headerEasFontTag=null;
  Element styleTag=null;
  int childrenCount=0;
  int subgroupsCount=0;
  List<HeaderGroupConfig> subGroups=new ArrayList();
  NodeList columnNodes=aTag.getChildNodes();
  int _currentLeavesCount=0;
  for (int c=0; c < columnNodes.getLength(); c++) {
    if ("String_Node_Str".equalsIgnoreCase(columnNodes.item(c).getNodeName()))     cellTag=(Element)columnNodes.item(c);
 else     if ("String_Node_Str".equalsIgnoreCase(columnNodes.item(c).getNodeName()))     modelElement=new ModelElementRef((Element)columnNodes.item(c),model);
 else     if ("String_Node_Str".equalsIgnoreCase(columnNodes.item(c).getNodeName()))     controlTag=(Element)columnNodes.item(c);
 else     if ("String_Node_Str".equalsIgnoreCase(columnNodes.item(c).getNodeName()))     columnsDatasource=new ModelElementRef((Element)columnNodes.item(c),model);
 else     if ("String_Node_Str".equalsIgnoreCase(columnNodes.item(c).getNodeName()))     columnsDisplayField=new ModelElementRef((Element)columnNodes.item(c),model);
 else     if ("String_Node_Str".equalsIgnoreCase(columnNodes.item(c).getNodeName()))     cellsDatasource=new ModelElementRef((Element)columnNodes.item(c),model);
 else     if ("String_Node_Str".equalsIgnoreCase(columnNodes.item(c).getNodeName()))     headerEasFontTag=(Element)columnNodes.item(c);
 else     if ("String_Node_Str".equalsIgnoreCase(columnNodes.item(c).getNodeName()))     styleTag=(Element)columnNodes.item(c);
 else     if ("String_Node_Str".equalsIgnoreCase(columnNodes.item(c).getNodeName())) {
      if (_currentLeavesCount == 0)       _currentLeavesCount=currentLeavesCount;
      childrenCount++;
      HeaderGroupConfig subGroup=processColumn((Element)columnNodes.item(c),deepness + 1);
      subGroups.add(subGroup);
      if (subGroup != null)       subgroupsCount++;
    }
  }
  if (childrenCount > 0) {
    HeaderGroupConfig group=new HeaderGroupConfig((title != null && !title.isEmpty()) ? title : name);
    groups.add(group);
    group.setRow(deepness);
    group.setColumn(_currentLeavesCount);
    group.setRowspan(1);
    int colSpan=0;
    for (    HeaderGroupConfig subGroup : subGroups) {
      if (subGroup == null)       colSpan++;
 else       colSpan+=subGroup.getColspan();
    }
    group.setColspan(colSpan);
    return group;
  }
 else {
    currentLeavesCount++;
    ColumnConfig<Row,?> cc=configureColumn(name,title,width,modelElement,aTag,controlTag);
    if (cc != null) {
      cc.setHidden(!visible);
    }
    return null;
  }
}