Program: 107800
Project: 107800
Buggy source:
/** 
 * Creates the required controls.
 * @param parent
 */
private void create(final Composite parent){
  this.table=SWTUtil.createTableDynamic(parent,SWT.SINGLE | SWT.V_SCROLL | SWT.FULL_SELECTION);
  this.table.setHeaderVisible(true);
  this.table.setLinesVisible(true);
  this.table.setLayoutData(SWTUtil.createFillGridData());
  SWTUtil.createGenericTooltip(table);
  DynamicTableColumn column0=new DynamicTableColumn(table,SWT.NONE);
  column0.setText("String_Node_Str");
  column0.setWidth("String_Node_Str","String_Node_Str");
  DynamicTableColumn column1=new DynamicTableColumn(table,SWT.NONE);
  column1.setText(Resources.getMessage("String_Node_Str"));
  column1.setWidth("String_Node_Str","String_Node_Str");
  DynamicTableColumn column2=new DynamicTableColumn(table,SWT.NONE);
  column2.setText(Resources.getMessage("String_Node_Str"));
  column2.setWidth("String_Node_Str","String_Node_Str");
  DynamicTableColumn column3=new DynamicTableColumn(table,SWT.NONE);
  column3.setText(Resources.getMessage("String_Node_Str"));
  column3.setWidth("String_Node_Str","String_Node_Str");
  DynamicTableColumn column4=new DynamicTableColumn(table,SWT.NONE);
  column4.setText(Resources.getMessage("String_Node_Str"));
  column4.setWidth("String_Node_Str","String_Node_Str");
  column1.pack();
  column2.pack();
  column3.pack();
  column4.pack();
  this.table.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent arg0){
      if (model == null || model.getInputConfig() == null || model.getInputConfig().getInput() == null) {
        return;
      }
      int index=table.getSelectionIndex();
      if (index >= 0 && index <= model.getInputConfig().getInput().getHandle().getNumColumns()) {
        String attribute=model.getInputConfig().getInput().getHandle().getAttributeName(index);
        model.setSelectedAttribute(attribute);
        controller.update(new ModelEvent(this,ModelPart.SELECTED_ATTRIBUTE,attribute));
      }
    }
  }
);
  final Menu menu=new Menu(this.table);
  for (  final String type : getDataTypes()) {
    MenuItem item=new MenuItem(menu,SWT.NONE);
    item.setText(type);
    item.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent arg0){
        actionDataTypeChanged(type);
      }
    }
);
  }
  this.table.addMouseListener(new MouseAdapter(){
    @Override public void mouseDown(    MouseEvent e){
      Point pt=new Point(e.x,e.y);
      int index=table.getTopIndex();
      while (index < table.getItemCount()) {
        TableItem item=table.getItem(index);
        for (int i=0; i < 5; i++) {
          Rectangle rect=item.getBounds(i);
          if (rect.contains(pt)) {
            if ((i == 2 || i == 3) && e.button == SWT.BUTTON3) {
              menu.setLocation(table.toDisplay(e.x,e.y));
              menu.setVisible(true);
              return;
            }
 else             if (i == 4 && e.button == SWT.BUTTON1) {
              String attribute=model.getInputConfig().getInput().getHandle().getAttributeName(index);
              boolean isResponseVariable=!model.getInputDefinition().isResponseVariable(attribute);
              model.getInputDefinition().setResponseVariable(attribute,isResponseVariable);
              item.setImage(0,controller.getResources().getImage(model.getInputDefinition().getAttributeType(attribute),isResponseVariable));
              item.setImage(4,isResponseVariable ? IMAGE_ENABLED : IMAGE_DISABLED);
              controller.update(new ModelEvent(this,ModelPart.RESPONSE_VARIABLES,attribute));
              return;
            }
          }
        }
        index++;
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Creates the required controls.
 * @param parent
 */
private void create(final Composite parent){
  this.table=SWTUtil.createTableDynamic(parent,SWT.SINGLE | SWT.V_SCROLL | SWT.FULL_SELECTION);
  this.table.setHeaderVisible(true);
  this.table.setLinesVisible(true);
  this.table.setLayoutData(SWTUtil.createFillGridData());
  SWTUtil.createGenericTooltip(table);
  DynamicTableColumn column0=new DynamicTableColumn(table,SWT.NONE);
  column0.setText("String_Node_Str");
  column0.setWidth("String_Node_Str","String_Node_Str");
  DynamicTableColumn column1=new DynamicTableColumn(table,SWT.NONE);
  column1.setText(Resources.getMessage("String_Node_Str"));
  column1.setWidth("String_Node_Str","String_Node_Str");
  DynamicTableColumn column2=new DynamicTableColumn(table,SWT.NONE);
  column2.setText(Resources.getMessage("String_Node_Str"));
  column2.setWidth("String_Node_Str","String_Node_Str");
  DynamicTableColumn column3=new DynamicTableColumn(table,SWT.NONE);
  column3.setText(Resources.getMessage("String_Node_Str"));
  column3.setWidth("String_Node_Str","String_Node_Str");
  DynamicTableColumn column4=new DynamicTableColumn(table,SWT.NONE);
  column4.setText(Resources.getMessage("String_Node_Str"));
  column4.setWidth("String_Node_Str","String_Node_Str");
  column1.pack();
  column2.pack();
  column3.pack();
  column4.pack();
  this.table.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent arg0){
      if (model == null || model.getInputConfig() == null || model.getInputConfig().getInput() == null) {
        return;
      }
      int index=table.getSelectionIndex();
      if (index >= 0 && index <= model.getInputConfig().getInput().getHandle().getNumColumns()) {
        String attribute=model.getInputConfig().getInput().getHandle().getAttributeName(index);
        model.setSelectedAttribute(attribute);
        controller.update(new ModelEvent(this,ModelPart.SELECTED_ATTRIBUTE,attribute));
      }
    }
  }
);
  final Menu menu=new Menu(this.table);
  for (  final String type : getDataTypes()) {
    MenuItem item=new MenuItem(menu,SWT.NONE);
    item.setText(type);
    item.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent arg0){
        actionDataTypeChanged(type);
      }
    }
);
  }
  this.table.addMouseListener(new MouseAdapter(){
    @Override public void mouseDown(    MouseEvent e){
      Point pt=new Point(e.x,e.y);
      int index=table.getTopIndex();
      while (index < table.getItemCount()) {
        TableItem item=table.getItem(index);
        for (int i=0; i < 5; i++) {
          Rectangle rect=item.getBounds(i);
          if (rect.contains(pt)) {
            if ((i == 2 || i == 3) && e.button == 3) {
              menu.setLocation(table.toDisplay(e.x,e.y));
              menu.setVisible(true);
              return;
            }
 else             if (i == 4 && e.button == 1) {
              String attribute=model.getInputConfig().getInput().getHandle().getAttributeName(index);
              boolean isResponseVariable=!model.getInputDefinition().isResponseVariable(attribute);
              model.getInputDefinition().setResponseVariable(attribute,isResponseVariable);
              item.setImage(0,controller.getResources().getImage(model.getInputDefinition().getAttributeType(attribute),isResponseVariable));
              item.setImage(4,isResponseVariable ? IMAGE_ENABLED : IMAGE_DISABLED);
              controller.update(new ModelEvent(this,ModelPart.RESPONSE_VARIABLES,attribute));
              return;
            }
          }
        }
        index++;
      }
    }
  }
);
}