Program: 124114
Project: 124114
Buggy source:
private void addItemElements(List<RepositoryObject> elements){
  if (elements == null || elements.isEmpty()) {
    return;
  }
  final Color redColor=Display.getDefault().getSystemColor(SWT.COLOR_RED);
  for (  final RepositoryObject object : elements) {
    if (object.isDeleted()) {
      continue;
    }
    TableItem tableItem=null;
    ERepositoryObjectType objectType=object.getRepositoryNode().getObjectType();
    ERepositoryObjectType type=object.getRepositoryNode().getContentType();
    if (!objectType.equals(ERepositoryObjectType.JOB_DOC) && !objectType.equals(ERepositoryObjectType.JOBLET_DOC)) {
      if (isTechinalStatus()) {
        if (!ERepositoryObjectType.DOCUMENTATION.equals(type) && !ERepositoryObjectType.BUSINESS_PROCESS.equals(type) && !ERepositoryObjectType.JOBLETS.equals(type)) {
          itemTable.setRedraw(false);
          tableItem=new TableItem(itemTable,SWT.NONE);
        }
      }
 else       if (isDocumentStatus()) {
        if (ERepositoryObjectType.DOCUMENTATION.equals(type) || ERepositoryObjectType.BUSINESS_PROCESS.equals(type)) {
          itemTable.setRedraw(false);
          tableItem=new TableItem(itemTable,SWT.NONE);
        }
      }
 else {
        itemTable.setRedraw(false);
        tableItem=new TableItem(itemTable,SWT.NONE);
      }
    }
 else {
      if (isDocumentStatus()) {
        if (type.equals(ERepositoryObjectType.JOBS) || type.equals(ERepositoryObjectType.JOBLETS)) {
          itemTable.setRedraw(false);
          tableItem=new TableItem(itemTable,SWT.NONE);
        }
      }
    }
    if (tableItem != null) {
      tableItem.setData(object);
      try {
        statusHelper.getStatusList(object.getProperty());
      }
 catch (      PersistenceException e1) {
      }
      object.getProperty().setOldStatusCode(statusHelper.getStatusCode(object.getStatusCode()));
      ERepositoryObjectType itemType=object.getRepositoryObjectType();
      tableItem.setImage(getItemsImage(CoreImageProvider.getIcon(itemType)));
      tableItem.setText(object.getLabel());
      tableItem.setText(1,statusHelper.getStatusLabel(object.getStatusCode()));
      TableEditor versionEditor=null;
      if (isFixedstatus()) {
        String version=statusCombo.getText();
        tableItem.setText(2,version);
        if (!object.getProperty().getOldStatusCode().equals(statusHelper.getStatusCode(version))) {
          tableItem.setForeground(2,redColor);
        }
 else {
          tableItem.setForeground(2,Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
        }
      }
 else {
        versionEditor=new TableEditor(itemTable);
        Composite versionComposit=new Composite(itemTable,SWT.NONE);
        GridLayout layout=new GridLayout(3,false);
        layout.horizontalSpacing=1;
        layout.verticalSpacing=0;
        layout.marginHeight=0;
        layout.marginWidth=0;
        versionComposit.setLayout(layout);
        final CCombo statusItemCombo=new CCombo(versionComposit,SWT.BORDER | SWT.READ_ONLY);
        GridData data=new GridData(GridData.FILL_HORIZONTAL);
        statusItemCombo.setLayoutData(data);
        statusItemCombo.setEditable(false);
        if (!type.equals(ERepositoryObjectType.DOCUMENTATION) && !type.equals(ERepositoryObjectType.BUSINESS_PROCESS)) {
          statusItemCombo.setItems(toArray(technicalStatusList));
          statusItemCombo.select(0);
          if (!object.getProperty().getOldStatusCode().equals("String_Node_Str")) {
            statusItemCombo.setForeground(redColor);
          }
 else {
            statusItemCombo.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
          }
        }
 else {
          statusItemCombo.setItems(toArray(documentStatusList));
          statusItemCombo.select(0);
          if (!object.getProperty().getOldStatusCode().equals("String_Node_Str")) {
            statusItemCombo.setForeground(redColor);
          }
 else {
            statusItemCombo.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
          }
        }
        statusItemCombo.addSelectionListener(new SelectionAdapter(){
          public void widgetSelected(          SelectionEvent e){
            String version=statusItemCombo.getText();
            String status=statusHelper.getStatusCode(version);
            if (!status.equals(object.getProperty().getOldStatusCode())) {
              statusItemCombo.setForeground(redColor);
            }
            object.getProperty().setStatusCode(statusHelper.getStatusCode(version));
          }
        }
);
        versionEditor.minimumWidth=itemTable.getColumn(2).getWidth();
        versionEditor.setEditor(versionComposit,tableItem,2);
      }
      TableEditor delEditor=new TableEditor(itemTable);
      Label delLabel=new Label(itemTable,SWT.CENTER);
      delLabel.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
      delLabel.setImage(ImageProvider.getImage(EImage.DELETE_ICON));
      delLabel.setToolTipText(Messages.getString("String_Node_Str"));
      delLabel.pack();
      addLabelMouseListener(delLabel,object,tableItem);
      delEditor.minimumWidth=25;
      delEditor.horizontalAlignment=SWT.CENTER;
      delEditor.setEditor(delLabel,tableItem,3);
      if (isFixedstatus()) {
        tableItem.setData(ITEM_EDITOR_KEY,new TableEditor[]{delEditor});
      }
 else       if (versionEditor != null) {
        tableItem.setData(ITEM_EDITOR_KEY,new TableEditor[]{versionEditor,delEditor});
      }
      itemTable.setRedraw(true);
    }
  }
}

Fixed version (ground truth):
private void addItemElements(List<RepositoryObject> elements){
  if (elements == null || elements.isEmpty()) {
    return;
  }
  final Color redColor=Display.getDefault().getSystemColor(SWT.COLOR_RED);
  for (  final RepositoryObject object : elements) {
    if (object.isDeleted()) {
      continue;
    }
    TableItem tableItem=null;
    ERepositoryObjectType objectType=object.getRepositoryNode().getObjectType();
    ERepositoryObjectType type=object.getRepositoryNode().getContentType();
    if (!objectType.equals(ERepositoryObjectType.JOB_DOC) && !objectType.equals(ERepositoryObjectType.JOBLET_DOC)) {
      if (isTechinalStatus()) {
        if (!ERepositoryObjectType.DOCUMENTATION.equals(type) && !ERepositoryObjectType.BUSINESS_PROCESS.equals(type) && !ERepositoryObjectType.JOBLETS.equals(type)) {
          itemTable.setRedraw(false);
          tableItem=new TableItem(itemTable,SWT.NONE);
        }
      }
 else       if (isDocumentStatus()) {
        if (ERepositoryObjectType.DOCUMENTATION.equals(type) || ERepositoryObjectType.BUSINESS_PROCESS.equals(type)) {
          itemTable.setRedraw(false);
          tableItem=new TableItem(itemTable,SWT.NONE);
        }
      }
 else {
        itemTable.setRedraw(false);
        tableItem=new TableItem(itemTable,SWT.NONE);
      }
    }
 else {
      if (isDocumentStatus()) {
        if (type.equals(ERepositoryObjectType.JOBS) || type.equals(ERepositoryObjectType.JOBLETS) || type.equals(ERepositoryObjectType.JOB_DOC)|| type.equals(ERepositoryObjectType.JOBLET_DOC)) {
          itemTable.setRedraw(false);
          tableItem=new TableItem(itemTable,SWT.NONE);
        }
      }
    }
    if (tableItem != null) {
      tableItem.setData(object);
      try {
        statusHelper.getStatusList(object.getProperty());
      }
 catch (      PersistenceException e1) {
      }
      object.getProperty().setOldStatusCode(statusHelper.getStatusCode(object.getStatusCode()));
      ERepositoryObjectType itemType=object.getRepositoryObjectType();
      tableItem.setImage(getItemsImage(CoreImageProvider.getIcon(itemType)));
      tableItem.setText(object.getLabel());
      tableItem.setText(1,statusHelper.getStatusLabel(object.getStatusCode()));
      TableEditor versionEditor=null;
      if (isFixedstatus()) {
        String version=statusCombo.getText();
        tableItem.setText(2,version);
        if (!object.getProperty().getOldStatusCode().equals(statusHelper.getStatusCode(version))) {
          tableItem.setForeground(2,redColor);
        }
 else {
          tableItem.setForeground(2,Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
        }
      }
 else {
        versionEditor=new TableEditor(itemTable);
        Composite versionComposit=new Composite(itemTable,SWT.NONE);
        GridLayout layout=new GridLayout(3,false);
        layout.horizontalSpacing=1;
        layout.verticalSpacing=0;
        layout.marginHeight=0;
        layout.marginWidth=0;
        versionComposit.setLayout(layout);
        final CCombo statusItemCombo=new CCombo(versionComposit,SWT.BORDER | SWT.READ_ONLY);
        GridData data=new GridData(GridData.FILL_HORIZONTAL);
        statusItemCombo.setLayoutData(data);
        statusItemCombo.setEditable(false);
        if (!type.equals(ERepositoryObjectType.DOCUMENTATION) && !type.equals(ERepositoryObjectType.BUSINESS_PROCESS)) {
          statusItemCombo.setItems(toArray(technicalStatusList));
          statusItemCombo.select(0);
          if (!object.getProperty().getOldStatusCode().equals("String_Node_Str")) {
            statusItemCombo.setForeground(redColor);
          }
 else {
            statusItemCombo.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
          }
        }
 else {
          statusItemCombo.setItems(toArray(documentStatusList));
          statusItemCombo.select(0);
          if (!object.getProperty().getOldStatusCode().equals("String_Node_Str")) {
            statusItemCombo.setForeground(redColor);
          }
 else {
            statusItemCombo.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
          }
        }
        statusItemCombo.addSelectionListener(new SelectionAdapter(){
          public void widgetSelected(          SelectionEvent e){
            String version=statusItemCombo.getText();
            String status=statusHelper.getStatusCode(version);
            if (!status.equals(object.getProperty().getOldStatusCode())) {
              statusItemCombo.setForeground(redColor);
            }
            object.getProperty().setStatusCode(statusHelper.getStatusCode(version));
          }
        }
);
        versionEditor.minimumWidth=itemTable.getColumn(2).getWidth();
        versionEditor.setEditor(versionComposit,tableItem,2);
      }
      TableEditor delEditor=new TableEditor(itemTable);
      Label delLabel=new Label(itemTable,SWT.CENTER);
      delLabel.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
      delLabel.setImage(ImageProvider.getImage(EImage.DELETE_ICON));
      delLabel.setToolTipText(Messages.getString("String_Node_Str"));
      delLabel.pack();
      addLabelMouseListener(delLabel,object,tableItem);
      delEditor.minimumWidth=25;
      delEditor.horizontalAlignment=SWT.CENTER;
      delEditor.setEditor(delLabel,tableItem,3);
      if (isFixedstatus()) {
        tableItem.setData(ITEM_EDITOR_KEY,new TableEditor[]{delEditor});
      }
 else       if (versionEditor != null) {
        tableItem.setData(ITEM_EDITOR_KEY,new TableEditor[]{versionEditor,delEditor});
      }
      itemTable.setRedraw(true);
    }
  }
}