Program: 134553
Project: 134553
Buggy source:
/** 
 * @param parent
 */
private void privateCreateGeneratorControls(Composite parent){
  Label label=new Label(parent,SWT.NONE);
  label.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,true,true,2,1));
  label.setText("String_Node_Str");
  generatorsViewer=new TableViewer(parent,SWT.BORDER | SWT.FULL_SELECTION);
  generatorsTable=generatorsViewer.getTable();
  generatorsTable.setLinesVisible(true);
  generatorsTable.setHeaderVisible(true);
  generatorsTable.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  generatorsTable.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      validate();
    }
  }
);
  createTableColum(generatorsTable,"String_Node_Str",120);
  createTableColum(generatorsTable,"String_Node_Str",120);
  createTableColum(generatorsTable,"String_Node_Str",100);
  createTableColum(generatorsTable,"String_Node_Str",200);
  createTableColum(generatorsTable,"String_Node_Str",200);
  generatorsViewer.setLabelProvider(new ITableLabelProvider(){
    @Override public void removeListener(    ILabelProviderListener listener){
    }
    @Override public boolean isLabelProperty(    Object element,    String property){
      return false;
    }
    @Override public void dispose(){
    }
    @Override public void addListener(    ILabelProviderListener listener){
    }
    @Override public String getColumnText(    Object element,    int columnIndex){
      if (element instanceof CodeGeneratorConfig) {
        CodeGeneratorConfig conf=(CodeGeneratorConfig)element;
        String txt=null;
switch (columnIndex) {
case 0:
          txt=conf.getGroupId();
        break;
case 1:
      txt=conf.getArtifactId();
    break;
case 2:
  txt=conf.getVersion();
break;
case 3:
txt=conf.getGenClassName();
break;
case 4:
txt=conf.getGenOutputDirectory();
break;
}
return txt != null ? txt : "String_Node_Str";
}
return "String_Node_Str";
}
@Override public Image getColumnImage(Object element,int columnIndex){
return null;
}
}
);
Composite group=new Composite(parent,SWT.NONE);
group.setLayout(new GridLayout(1,false));
group.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,true));
addBtn=new Button(group,SWT.NONE);
addBtn.setLayoutData(new GridData(SWT.FILL,SWT.TOP,false,false));
addBtn.setText("String_Node_Str");
addBtn.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e){
YangCodeGeneratorDialog dialog=new YangCodeGeneratorDialog(getShell());
if (dialog.open() == Window.OK) {
generatorsViewer.add(dialog.getConfig());
}
}
}
);
editBtn=new Button(group,SWT.NONE);
editBtn.setLayoutData(new GridData(SWT.FILL,SWT.TOP,false,false));
editBtn.setText("String_Node_Str");
editBtn.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e){
CodeGeneratorConfig config=(CodeGeneratorConfig)generatorsViewer.getElementAt(generatorsTable.getSelectionIndex());
YangCodeGeneratorDialog dialog=new YangCodeGeneratorDialog(getShell(),config);
if (dialog.open() == Window.OK) {
generatorsViewer.update(dialog.getConfig(),null);
}
}
}
);
removeBtn=new Button(group,SWT.NONE);
removeBtn.setLayoutData(new GridData(SWT.LEFT,SWT.TOP,false,false));
removeBtn.setText("String_Node_Str");
removeBtn.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e){
if (generatorsTable.getSelectionCount() > 1) {
generatorsTable.remove(generatorsTable.getSelectionIndices());
validate();
}
}
}
);
validate();
}

Fixed version (ground truth):
/** 
 * @param parent
 */
private void privateCreateGeneratorControls(Composite parent){
  Label label=new Label(parent,SWT.NONE);
  label.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,true,true,2,1));
  label.setText("String_Node_Str");
  generatorsViewer=new TableViewer(parent,SWT.BORDER | SWT.FULL_SELECTION);
  generatorsTable=generatorsViewer.getTable();
  generatorsTable.setLinesVisible(true);
  generatorsTable.setHeaderVisible(true);
  generatorsTable.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  generatorsTable.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      validate();
    }
  }
);
  createTableColum(generatorsTable,"String_Node_Str",120);
  createTableColum(generatorsTable,"String_Node_Str",120);
  createTableColum(generatorsTable,"String_Node_Str",100);
  createTableColum(generatorsTable,"String_Node_Str",200);
  createTableColum(generatorsTable,"String_Node_Str",200);
  generatorsViewer.setLabelProvider(new ITableLabelProvider(){
    public void removeListener(    ILabelProviderListener listener){
    }
    public boolean isLabelProperty(    Object element,    String property){
      return false;
    }
    public void dispose(){
    }
    public void addListener(    ILabelProviderListener listener){
    }
    public String getColumnText(    Object element,    int columnIndex){
      if (element instanceof CodeGeneratorConfig) {
        CodeGeneratorConfig conf=(CodeGeneratorConfig)element;
        String txt=null;
switch (columnIndex) {
case 0:
          txt=conf.getGroupId();
        break;
case 1:
      txt=conf.getArtifactId();
    break;
case 2:
  txt=conf.getVersion();
break;
case 3:
txt=conf.getGenClassName();
break;
case 4:
txt=conf.getGenOutputDirectory();
break;
}
return txt != null ? txt : "String_Node_Str";
}
return "String_Node_Str";
}
public Image getColumnImage(Object element,int columnIndex){
return null;
}
}
);
Composite group=new Composite(parent,SWT.NONE);
group.setLayout(new GridLayout(1,false));
group.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,true));
addBtn=new Button(group,SWT.NONE);
addBtn.setLayoutData(new GridData(SWT.FILL,SWT.TOP,false,false));
addBtn.setText("String_Node_Str");
addBtn.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e){
YangCodeGeneratorDialog dialog=new YangCodeGeneratorDialog(getShell());
if (dialog.open() == Window.OK) {
generatorsViewer.add(dialog.getConfig());
}
}
}
);
editBtn=new Button(group,SWT.NONE);
editBtn.setLayoutData(new GridData(SWT.FILL,SWT.TOP,false,false));
editBtn.setText("String_Node_Str");
editBtn.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e){
CodeGeneratorConfig config=(CodeGeneratorConfig)generatorsViewer.getElementAt(generatorsTable.getSelectionIndex());
YangCodeGeneratorDialog dialog=new YangCodeGeneratorDialog(getShell(),config);
if (dialog.open() == Window.OK) {
generatorsViewer.update(dialog.getConfig(),null);
}
}
}
);
removeBtn=new Button(group,SWT.NONE);
removeBtn.setLayoutData(new GridData(SWT.LEFT,SWT.TOP,false,false));
removeBtn.setText("String_Node_Str");
removeBtn.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e){
if (generatorsTable.getSelectionCount() > 1) {
generatorsTable.remove(generatorsTable.getSelectionIndices());
validate();
}
}
}
);
validate();
}