Program: 138939
Project: 138939
Buggy source:
private void createChildrenNode(Tree tree,TreeItemContainer parentItem,TreeColumn[] treeColumns,IIndicatorNode[] branchNodes){
  for (int i=0; i < branchNodes.length; i++) {
    IIndicatorNode indicatorNode=branchNodes[i];
    if (!indicatorNode.getLabel().equals("String_Node_Str")) {
      final TreeItemContainer treeItem;
      if (parentItem == null) {
        treeItem=new TreeItemContainer(tree,SWT.NONE,treeColumns.length);
      }
 else {
        treeItem=new TreeItemContainer(parentItem,SWT.NONE,treeColumns.length);
      }
      TreeEditor editor;
      Button checkButton;
      Button rowCheckButton=null;
      Button commonCheckButton;
      List<Button> rowButtonList=new ArrayList<Button>();
      for (int j=0; j < treeColumns.length; j++) {
        IndicatorEnum indicatorEnum=indicatorNode.getIndicatorEnum();
        if (j == 0) {
          treeItem.setText(0,indicatorNode.getLabel());
          if (indicatorEnum != null) {
            treeItem.setData(INDICATORITEM,indicatorNode);
          }
          continue;
        }
 else         if (j == 1 && treeColumns.length > 2) {
          editor=new TreeEditor(tree);
          rowCheckButton=new Button(tree,SWT.CHECK);
          rowCheckButton.addSelectionListener(new RowSelectButtonListener(j,treeItem,indicatorEnum,null));
          checkButtons.add(rowCheckButton);
          Color systemColor=tree.getDisplay().getSystemColor(SWT.COLOR_YELLOW);
          treeItem.setBackground(j,systemColor);
          rowCheckButton.setBackground(systemColor);
          commonCheckButton=rowCheckButton;
        }
 else {
          editor=new TreeEditor(tree);
          checkButton=new Button(tree,SWT.CHECK);
          checkButton.setData(indicatorNode);
          if (((ModelElementIndicator)treeColumns[j].getData()).contains(indicatorEnum)) {
            checkButton.setSelection(true);
          }
          final ModelElementIndicator currentIndicator=(ModelElementIndicator)treeColumns[j].getData();
          checkButton.setEnabled(ModelElementIndicatorRule.match(indicatorNode,currentIndicator,this.language));
          if (null != indicatorNode.getIndicatorInstance() && !(indicatorNode.getIndicatorInstance() instanceof DatePatternFreqIndicator) && null != indicatorNode.getIndicatorInstance().getIndicatorDefinition() && dbms.getSqlExpression(indicatorNode.getIndicatorInstance().getIndicatorDefinition()) == null) {
            checkButton.setEnabled(false);
          }
          checkButton.addSelectionListener(new ButtonSelectionListener(j,treeItem,indicatorEnum,currentIndicator));
          if (indicatorEnum != null) {
            checkButton.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str",indicatorEnum.getLabel(),currentIndicator.getElementName()));
          }
          checkButton.setData(MODELELEMENTINDICATORFLAG,currentIndicator);
          commonCheckButton=checkButton;
          rowButtonList.add(checkButton);
          checkButtons.add(checkButton);
        }
        commonCheckButton.pack();
        editor.minimumWidth=commonCheckButton.getSize().x;
        editor.horizontalAlignment=SWT.CENTER;
        editor.setEditor(commonCheckButton,treeItem,j);
        treeItem.setButton(j,commonCheckButton);
      }
      if (rowCheckButton != null) {
        boolean allChecked=true;
        rowCheckButton.setData(ROWINDICATORFLAG,rowButtonList);
        for (        Button btn : rowButtonList) {
          if (!btn.getSelection()) {
            allChecked=false;
          }
        }
        rowCheckButton.setSelection(allChecked);
      }
      if (indicatorNode.hasChildren()) {
        createChildrenNode(tree,treeItem,treeColumns,indicatorNode.getChildren());
      }
      treeItem.setExpanded(false);
    }
  }
}

Fixed version (ground truth):
private void createChildrenNode(Tree tree,TreeItemContainer parentItem,TreeColumn[] treeColumns,IIndicatorNode[] branchNodes){
  boolean expanded=false;
  for (int i=0; i < branchNodes.length; i++) {
    IIndicatorNode indicatorNode=branchNodes[i];
    if (!indicatorNode.getLabel().equals("String_Node_Str")) {
      final TreeItemContainer treeItem;
      if (parentItem == null) {
        treeItem=new TreeItemContainer(tree,SWT.NONE,treeColumns.length);
      }
 else {
        treeItem=new TreeItemContainer(parentItem,SWT.NONE,treeColumns.length);
      }
      TreeEditor editor;
      Button checkButton;
      Button rowCheckButton=null;
      Button commonCheckButton;
      List<Button> rowButtonList=new ArrayList<Button>();
      for (int j=0; j < treeColumns.length; j++) {
        IndicatorEnum indicatorEnum=indicatorNode.getIndicatorEnum();
        if (j == 0) {
          treeItem.setText(0,indicatorNode.getLabel());
          if (indicatorEnum != null) {
            treeItem.setData(INDICATORITEM,indicatorNode);
          }
          continue;
        }
 else         if (j == 1 && treeColumns.length > 2) {
          editor=new TreeEditor(tree);
          rowCheckButton=new Button(tree,SWT.CHECK);
          rowCheckButton.addSelectionListener(new RowSelectButtonListener(j,treeItem,indicatorEnum,null));
          checkButtons.add(rowCheckButton);
          Color systemColor=tree.getDisplay().getSystemColor(SWT.COLOR_YELLOW);
          treeItem.setBackground(j,systemColor);
          rowCheckButton.setBackground(systemColor);
          commonCheckButton=rowCheckButton;
        }
 else {
          editor=new TreeEditor(tree);
          checkButton=new Button(tree,SWT.CHECK);
          checkButton.setData(indicatorNode);
          if (((ModelElementIndicator)treeColumns[j].getData()).contains(indicatorEnum)) {
            checkButton.setSelection(true);
            expanded=true;
          }
          final ModelElementIndicator currentIndicator=(ModelElementIndicator)treeColumns[j].getData();
          checkButton.setEnabled(ModelElementIndicatorRule.match(indicatorNode,currentIndicator,this.language));
          if (null != indicatorNode.getIndicatorInstance() && !(indicatorNode.getIndicatorInstance() instanceof DatePatternFreqIndicator) && null != indicatorNode.getIndicatorInstance().getIndicatorDefinition() && dbms.getSqlExpression(indicatorNode.getIndicatorInstance().getIndicatorDefinition()) == null) {
            checkButton.setEnabled(false);
          }
          checkButton.addSelectionListener(new ButtonSelectionListener(j,treeItem,indicatorEnum,currentIndicator));
          if (indicatorEnum != null) {
            checkButton.setToolTipText(DefaultMessagesImpl.getString("String_Node_Str",indicatorEnum.getLabel(),currentIndicator.getElementName()));
          }
          checkButton.setData(MODELELEMENTINDICATORFLAG,currentIndicator);
          commonCheckButton=checkButton;
          rowButtonList.add(checkButton);
          checkButtons.add(checkButton);
        }
        commonCheckButton.pack();
        editor.minimumWidth=commonCheckButton.getSize().x;
        editor.horizontalAlignment=SWT.CENTER;
        editor.setEditor(commonCheckButton,treeItem,j);
        treeItem.setButton(j,commonCheckButton);
      }
      if (rowCheckButton != null) {
        boolean allChecked=true;
        rowCheckButton.setData(ROWINDICATORFLAG,rowButtonList);
        for (        Button btn : rowButtonList) {
          if (!btn.getSelection()) {
            allChecked=false;
          }
        }
        rowCheckButton.setSelection(allChecked);
      }
      if (indicatorNode.hasChildren()) {
        createChildrenNode(tree,treeItem,treeColumns,indicatorNode.getChildren());
      }
      if (expanded) {
        TreeItem item=treeItem.getParentItem();
        while (null != item) {
          item.setExpanded(true);
          item=item.getParentItem();
        }
      }
    }
  }
}