Program: 147905
Project: 147905
Buggy source:
public void createControl(Composite parent){
  Composite composite=new Composite(parent,SWT.BORDER);
  composite.setLayout(new GridLayout(1,false));
  browseViewer=new TableViewer(composite,SWT.FULL_SELECTION | SWT.MULTI | SWT.H_SCROLL);
  GridData gd=new GridData(SWT.FILL,SWT.FILL,true,true,1,1);
  gd.widthHint=600;
  browseViewer.getControl().setLayoutData(gd);
  ((GridData)browseViewer.getControl().getLayoutData()).heightHint=100;
  Table table=browseViewer.getTable();
  TableColumn column=new TableColumn(table,SWT.CENTER);
  column.setText(INSTANCE_NAME);
  column.setWidth(615);
  table.setHeaderVisible(true);
  table.setLinesVisible(true);
  CellEditor[] editors=new CellEditor[1];
  editors[0]=new TextCellEditor(table);
  browseViewer.setCellEditors(editors);
  browseViewer.setContentProvider(new IStructuredContentProvider(){
    public void dispose(){
    }
    public void inputChanged(    Viewer viewer,    Object oldInput,    Object newInput){
    }
    public Object[] getElements(    Object inputElement){
      ArrayList<XSDElementDeclaration> values=(ArrayList<XSDElementDeclaration>)inputElement;
      return values.toArray(new XSDElementDeclaration[values.size()]);
    }
  }
);
  browseViewer.setLabelProvider(new ITableLabelProvider(){
    public boolean isLabelProperty(    Object element,    String property){
      return false;
    }
    public void dispose(){
    }
    public void addListener(    ILabelProviderListener listener){
    }
    public void removeListener(    ILabelProviderListener listener){
    }
    public String getColumnText(    Object element,    int columnIndex){
      return BROWSE_ITEMS + ((XSDElementDeclaration)element).getName();
    }
    public Image getColumnImage(    Object element,    int columnIndex){
      return null;
    }
  }
);
  browseViewer.setCellModifier(new ICellModifier(){
    public boolean canModify(    Object element,    String property){
      return true;
    }
    public void modify(    Object element,    String property,    Object value){
      TableItem item=(TableItem)element;
      if (Pattern.compile("String_Node_Str").matcher(value.toString()).matches() || value.toString().trim().replaceAll("String_Node_Str","String_Node_Str").length() != value.toString().trim().length()) {
        MessageDialog.openInformation(null,"String_Node_Str","String_Node_Str");
        return;
      }
      XSDElementDeclaration elem=(XSDElementDeclaration)item.getData();
      if (!(BROWSE_ITEMS + elem.getName()).equals(value.toString().trim())) {
        for (        XSDElementDeclaration theElem : declList) {
          if (theElem == elem)           continue;
          if ((BROWSE_ITEMS + theElem.getName()).equals(value.toString().trim())) {
            MessageDialog.openInformation(null,"String_Node_Str","String_Node_Str");
            return;
          }
        }
        List<Line> lines=browseItemToRoles.get(BROWSE_ITEMS + elem.getName());
        browseItemToRoles.remove(BROWSE_ITEMS + elem.getName());
        int prex=value.toString().trim().indexOf(BROWSE_ITEMS);
        elem.setName(value.toString().trim().substring(prex + BROWSE_ITEMS.length()));
        browseItemToRoles.put(value.toString().trim(),lines);
        refreshRoleView(BROWSE_ITEMS + elem.getName());
        browseViewer.update(elem,null);
      }
    }
    public Object getValue(    Object element,    String property){
      XSDElementDeclaration elem=(XSDElementDeclaration)element;
      return BROWSE_ITEMS + elem.getName();
    }
  }
);
  browseViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      applyChangeToRoles();
      IStructuredSelection selection=(IStructuredSelection)event.getSelection();
      if (selection.size() > 1) {
        List selectObjs=selection.toList();
        refreshRoleView(selectObjs);
        UpdateComplexViewButton(true);
      }
 else       if (selection.size() == 1) {
        XSDElementDeclaration decl=(XSDElementDeclaration)selection.getFirstElement();
        refreshRoleView(BROWSE_ITEMS + decl.getName());
        UpdateComplexViewButton(true);
      }
    }
  }
);
  browseViewer.setInput(declList);
  browseViewer.setColumnProperties(new String[]{INSTANCE_NAME});
  browseViewer.refresh();
  if (Util.IsEnterPrise()) {
    Label infoLabel=new Label(composite,SWT.NONE);
    infoLabel.setText("String_Node_Str");
    ComplexTableViewerColumn ruleColumn=roleConfigurationColumns[0];
    ruleColumn.setColumnWidth(250);
    List<String> roles=getAllRoleNames();
    ruleColumn.setComboValues(roles.toArray(new String[]{}));
    ComplexTableViewerColumn acsColumn=roleConfigurationColumns[1];
    acsColumn.setColumnWidth(250);
    acsColumn.setComboValues(new String[]{"String_Node_Str","String_Node_Str"});
    complexTableViewer=new ComplexTableViewer(Arrays.asList(roleConfigurationColumns),WidgetFactory.getWidgetFactory(),composite);
    complexTableViewer.setKeyColumns(new ComplexTableViewerColumn[]{roleConfigurationColumns[0]});
    complexTableViewer.create();
    complexTableViewer.getViewer().setInput(new ArrayList<Line>());
    UpdateComplexViewButton(false);
  }
  setControl(composite);
}

Fixed version (ground truth):
public void createControl(Composite parent){
  Composite composite=new Composite(parent,SWT.BORDER);
  composite.setLayout(new GridLayout(1,false));
  browseViewer=new TableViewer(composite,SWT.FULL_SELECTION | SWT.MULTI | SWT.H_SCROLL);
  GridData gd=new GridData(SWT.FILL,SWT.FILL,true,true,1,1);
  gd.widthHint=600;
  browseViewer.getControl().setLayoutData(gd);
  ((GridData)browseViewer.getControl().getLayoutData()).heightHint=100;
  Table table=browseViewer.getTable();
  TableColumn column=new TableColumn(table,SWT.CENTER);
  column.setText(INSTANCE_NAME);
  column.setWidth(615);
  table.setHeaderVisible(true);
  table.setLinesVisible(true);
  CellEditor[] editors=new CellEditor[1];
  editors[0]=new TextCellEditor(table);
  browseViewer.setCellEditors(editors);
  browseViewer.setContentProvider(new IStructuredContentProvider(){
    public void dispose(){
    }
    public void inputChanged(    Viewer viewer,    Object oldInput,    Object newInput){
    }
    public Object[] getElements(    Object inputElement){
      ArrayList<XSDElementDeclaration> values=(ArrayList<XSDElementDeclaration>)inputElement;
      return values.toArray(new XSDElementDeclaration[values.size()]);
    }
  }
);
  browseViewer.setLabelProvider(new ITableLabelProvider(){
    public boolean isLabelProperty(    Object element,    String property){
      return false;
    }
    public void dispose(){
    }
    public void addListener(    ILabelProviderListener listener){
    }
    public void removeListener(    ILabelProviderListener listener){
    }
    public String getColumnText(    Object element,    int columnIndex){
      return BROWSE_ITEMS + ((XSDElementDeclaration)element).getName();
    }
    public Image getColumnImage(    Object element,    int columnIndex){
      return null;
    }
  }
);
  browseViewer.setCellModifier(new ICellModifier(){
    public boolean canModify(    Object element,    String property){
      return true;
    }
    public void modify(    Object element,    String property,    Object value){
      TableItem item=(TableItem)element;
      if (Pattern.compile("String_Node_Str").matcher(value.toString()).matches() || value.toString().trim().replaceAll("String_Node_Str","String_Node_Str").length() != value.toString().trim().length()) {
        MessageDialog.openInformation(null,"String_Node_Str","String_Node_Str");
        return;
      }
      XSDElementDeclaration elem=(XSDElementDeclaration)item.getData();
      if (!(BROWSE_ITEMS + elem.getName()).equals(value.toString().trim())) {
        for (        XSDElementDeclaration theElem : declList) {
          if (theElem == elem)           continue;
          if ((BROWSE_ITEMS + theElem.getName()).equals(value.toString().trim())) {
            MessageDialog.openInformation(null,"String_Node_Str","String_Node_Str");
            return;
          }
        }
        List<Line> lines=browseItemToRoles.get(BROWSE_ITEMS + elem.getName());
        browseItemToRoles.remove(BROWSE_ITEMS + elem.getName());
        int prex=value.toString().trim().indexOf(BROWSE_ITEMS);
        if ((prex + BROWSE_ITEMS.length()) <= value.toString().trim().length())         elem.setName(value.toString().trim().substring(prex + BROWSE_ITEMS.length()));
        browseItemToRoles.put(value.toString().trim(),lines);
        refreshRoleView(BROWSE_ITEMS + elem.getName());
        browseViewer.update(elem,null);
      }
    }
    public Object getValue(    Object element,    String property){
      XSDElementDeclaration elem=(XSDElementDeclaration)element;
      return BROWSE_ITEMS + elem.getName();
    }
  }
);
  browseViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      applyChangeToRoles();
      IStructuredSelection selection=(IStructuredSelection)event.getSelection();
      if (selection.size() > 1) {
        List selectObjs=selection.toList();
        refreshRoleView(selectObjs);
        UpdateComplexViewButton(true);
      }
 else       if (selection.size() == 1) {
        XSDElementDeclaration decl=(XSDElementDeclaration)selection.getFirstElement();
        refreshRoleView(BROWSE_ITEMS + decl.getName());
        UpdateComplexViewButton(true);
      }
    }
  }
);
  browseViewer.setInput(declList);
  browseViewer.setColumnProperties(new String[]{INSTANCE_NAME});
  browseViewer.refresh();
  if (Util.IsEnterPrise()) {
    Label infoLabel=new Label(composite,SWT.NONE);
    infoLabel.setText("String_Node_Str");
    ComplexTableViewerColumn ruleColumn=roleConfigurationColumns[0];
    ruleColumn.setColumnWidth(250);
    List<String> roles=getAllRoleNames();
    ruleColumn.setComboValues(roles.toArray(new String[]{}));
    ComplexTableViewerColumn acsColumn=roleConfigurationColumns[1];
    acsColumn.setColumnWidth(250);
    acsColumn.setComboValues(new String[]{"String_Node_Str","String_Node_Str"});
    complexTableViewer=new ComplexTableViewer(Arrays.asList(roleConfigurationColumns),WidgetFactory.getWidgetFactory(),composite);
    complexTableViewer.setKeyColumns(new ComplexTableViewerColumn[]{roleConfigurationColumns[0]});
    complexTableViewer.create();
    complexTableViewer.getViewer().setInput(new ArrayList<Line>());
    UpdateComplexViewButton(false);
  }
  setControl(composite);
}