Program: 148931
Project: 148931
Buggy source:
protected void createTexts(){
  for (Iterator<ComplexTableViewerColumn> iterator=columns.iterator(); iterator.hasNext(); ) {
    ComplexTableViewerColumn column=iterator.next();
    if (column.isCombo()) {
      CCombo combo=new CCombo(mainComposite,SWT.BORDER | SWT.READ_ONLY);
      GridData gd=new GridData(SWT.NONE,SWT.TOP,false,false,1,1);
      if (column.getColumnWidth() > 0)       gd.widthHint=column.getColumnWidth();
      combo.setLayoutData(gd);
      combo.setItems(column.getComboValues());
      if (column.getDefaultValue() == null || column.getDefaultValue().length() == 0) {
        combo.select(0);
      }
 else {
        combo.setText(column.getDefaultValue());
      }
      if (column.isComboEditable()) {
        combo.setEditable(true);
        combo.setText("String_Node_Str");
      }
      column.setControl(combo);
    }
 else {
      int style=SWT.BORDER;
      if (column.getTextLines() > 1) {
        style=SWT.BORDER | SWT.MULTI | SWT.V_SCROLL| SWT.H_SCROLL;
      }
      final Text text=toolkit.createText(mainComposite,column.getDefaultValue(),style);
      GridData gdata=new GridData(SWT.FILL,SWT.FILL,true,true,1,1);
      if (column.getTextLines() > 1)       gdata.heightHint=text.getLineHeight() * column.getTextLines();
      text.setLayoutData(gdata);
      column.setControl(text);
      text.addFocusListener(new FocusAdapter(){
        @Override public void focusGained(        FocusEvent e){
          text.selectAll();
        }
      }
);
    }
  }
  addNewXpathButton=toolkit.createButton(mainComposite,"String_Node_Str",SWT.PUSH | SWT.CENTER);
  addNewXpathButton.setLayoutData(new GridData(SWT.FILL,SWT.BOTTOM,false,false,1,1));
  addNewXpathButton.setImage(ImageCache.getCreatedImage(EImage.ADD_NEWXPATH.getPath()));
  addNewXpathButton.setToolTipText("String_Node_Str");
  addNewXpathButton.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    org.eclipse.swt.events.SelectionEvent e){
    }
    @SuppressWarnings("String_Node_Str") public void widgetSelected(    org.eclipse.swt.events.SelectionEvent e){
      String uniqueVal="String_Node_Str";
      String keyVal="String_Node_Str";
      for (Iterator<ComplexTableViewerColumn> iterator=columns.iterator(); iterator.hasNext(); ) {
        ComplexTableViewerColumn column=iterator.next();
        String text="String_Node_Str";
        if (column.isCombo()) {
          text=((CCombo)column.getControl()).getText();
        }
 else         if (column.isText()) {
          text=((Text)column.getControl()).getText();
        }
 else         if (column.isXPATH()) {
          Control text1=((Composite)column.getControl()).getChildren()[0];
          if (text1 instanceof Text) {
            text=((Text)text1).getText();
          }
        }
        if (text.length() == 0) {
          if (column.isNillable()) {
            text=column.getNillValue();
            if (column.isCombo()) {
              ((CCombo)column.getControl()).setText(text);
            }
 else {
              ((Text)column.getControl()).setText(text);
            }
          }
 else {
            MessageDialog.openError(ComplexTableViewer.this.getViewer().getControl().getShell(),"String_Node_Str","String_Node_Str" + column.getName() + "String_Node_Str");
            return;
          }
        }
        if (keyColumns != null && Arrays.asList(keyColumns).indexOf(column) >= 0) {
          keyVal+=text;
        }
        uniqueVal+="String_Node_Str" + text;
      }
      List<Line> list=(List<Line>)getViewer().getInput();
      for (      Line line : list) {
        String thisLineVal="String_Node_Str";
        for (        KeyValue keyvalue : line.keyValues) {
          thisLineVal+="String_Node_Str" + keyvalue.value;
        }
        if (thisLineVal.equals(uniqueVal) || (keyVal.length() > 0 && thisLineVal.indexOf(keyVal) >= 0)) {
          MessageDialog.openInformation(null,ERROR_ITEMALREADYEXISTS_TITLE,ERROR_ITEMALREADYEXISTS_CONTENT);
          return;
        }
      }
      Line line=new Line(columns.toArray(new ComplexTableViewerColumn[columns.size()]),getTextValues());
      list.add(line);
      markDirty();
      viewer.setSelection(null);
      viewer.refresh();
      viewer.getTable().select(viewer.getTable().getItemCount() - 1);
    }
  }
);
}

Fixed version (ground truth):
protected void createTexts(){
  for (Iterator<ComplexTableViewerColumn> iterator=columns.iterator(); iterator.hasNext(); ) {
    ComplexTableViewerColumn column=iterator.next();
    if (column.isCombo()) {
      CCombo combo=new CCombo(mainComposite,SWT.BORDER | SWT.READ_ONLY);
      GridData gd=new GridData(SWT.NONE,SWT.TOP,false,false,1,1);
      if (column.getColumnWidth() > 0)       gd.widthHint=column.getColumnWidth();
      combo.setLayoutData(gd);
      combo.setItems(column.getComboValues());
      if (column.getDefaultValue() == null || column.getDefaultValue().length() == 0) {
        combo.select(0);
      }
 else {
        combo.setText(column.getDefaultValue());
      }
      if (column.isComboEditable()) {
        combo.setEditable(true);
        combo.setText("String_Node_Str");
      }
      column.setControl(combo);
    }
 else {
      int style=SWT.BORDER;
      if (column.getTextLines() > 1) {
        style=SWT.BORDER | SWT.MULTI | SWT.V_SCROLL| SWT.H_SCROLL;
      }
      final Text text=toolkit.createText(mainComposite,column.getDefaultValue(),style);
      GridData gdata=new GridData(SWT.FILL,SWT.FILL,true,true,1,1);
      if (column.getTextLines() > 1)       gdata.heightHint=text.getLineHeight() * column.getTextLines();
      text.setLayoutData(gdata);
      column.setControl(text);
      text.addFocusListener(new FocusAdapter(){
        @Override public void focusGained(        FocusEvent e){
          text.selectAll();
        }
      }
);
    }
  }
  addButton=toolkit.createButton(mainComposite,"String_Node_Str",SWT.PUSH | SWT.CENTER);
  addButton.setLayoutData(new GridData(SWT.FILL,SWT.BOTTOM,false,false,1,1));
  addButton.setImage(ImageCache.getCreatedImage(EImage.ADD_OBJ.getPath()));
  addButton.setToolTipText("String_Node_Str");
  addButton.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    org.eclipse.swt.events.SelectionEvent e){
    }
    @SuppressWarnings("String_Node_Str") public void widgetSelected(    org.eclipse.swt.events.SelectionEvent e){
      String uniqueVal="String_Node_Str";
      String keyVal="String_Node_Str";
      for (Iterator<ComplexTableViewerColumn> iterator=columns.iterator(); iterator.hasNext(); ) {
        ComplexTableViewerColumn column=iterator.next();
        String text="String_Node_Str";
        if (column.isCombo()) {
          text=((CCombo)column.getControl()).getText();
        }
 else         if (column.isText()) {
          text=((Text)column.getControl()).getText();
        }
 else         if (column.isXPATH()) {
          Control text1=((Composite)column.getControl()).getChildren()[0];
          if (text1 instanceof Text) {
            text=((Text)text1).getText();
          }
        }
        if (text.length() == 0) {
          if (column.isNillable()) {
            text=column.getNillValue();
            if (column.isCombo()) {
              ((CCombo)column.getControl()).setText(text);
            }
 else {
              ((Text)column.getControl()).setText(text);
            }
          }
 else {
            MessageDialog.openError(ComplexTableViewer.this.getViewer().getControl().getShell(),"String_Node_Str","String_Node_Str" + column.getName() + "String_Node_Str");
            return;
          }
        }
        if (keyColumns != null && Arrays.asList(keyColumns).indexOf(column) >= 0) {
          keyVal+=text;
        }
        uniqueVal+="String_Node_Str" + text;
      }
      List<Line> list=(List<Line>)getViewer().getInput();
      for (      Line line : list) {
        String thisLineVal="String_Node_Str";
        for (        KeyValue keyvalue : line.keyValues) {
          thisLineVal+="String_Node_Str" + keyvalue.value;
        }
        if (thisLineVal.equals(uniqueVal) || (keyVal.length() > 0 && thisLineVal.indexOf(keyVal) >= 0)) {
          MessageDialog.openInformation(null,ERROR_ITEMALREADYEXISTS_TITLE,ERROR_ITEMALREADYEXISTS_CONTENT);
          return;
        }
      }
      Line line=new Line(columns.toArray(new ComplexTableViewerColumn[columns.size()]),getTextValues());
      list.add(line);
      markDirty();
      viewer.setSelection(null);
      viewer.refresh();
      viewer.getTable().select(viewer.getTable().getItemCount() - 1);
    }
  }
);
}