Program: 73537
Project: 73537
Buggy source:
public Composite createArea(Composite parent){
  int numColumns=2;
  if (description != null && description.length() > 0) {
    numColumns++;
  }
  if ((style & BUTTON_AGGREGATION) == BUTTON_AGGREGATION) {
    numColumns++;
  }
  if ((style & BUTTON_GROUP) == BUTTON_GROUP) {
    numColumns++;
  }
  cmpTop=new Composite(parent,SWT.NONE);
{
    GridLayout glContent=new GridLayout();
    glContent.numColumns=numColumns;
    glContent.marginHeight=0;
    glContent.marginWidth=0;
    glContent.horizontalSpacing=2;
    cmpTop.setLayout(glContent);
    GridData gd=new GridData(GridData.FILL_HORIZONTAL);
    cmpTop.setLayoutData(gd);
  }
  if (description != null && description.length() > 0) {
    Label lblDesc=new Label(cmpTop,SWT.NONE);
    lblDesc.setText(description);
    lblDesc.setToolTipText(tooltipWhenBlank);
  }
  if ((style & BUTTON_AGGREGATION) == BUTTON_AGGREGATION) {
    createAggregationItem(cmpTop);
  }
  Object[] predefinedQuery=context.getPredefinedQuery(queryType);
  if (predefinedQuery != null) {
    cmbDefinition=new Combo(cmpTop,context.getDataServiceProvider().isInXTab() ? SWT.READ_ONLY : SWT.NONE);
    GridData gd=new GridData(GridData.FILL_HORIZONTAL);
    cmbDefinition.setLayoutData(gd);
    if (predefinedQuery.length > 0) {
      populateExprComboItems(predefinedQuery);
    }
    initComboExprText();
    cmbDefinition.addListener(SWT.Selection,new Listener(){
      public void handleEvent(      Event event){
        query.setDefinition(getExpression(cmbDefinition));
        updateGroupingAggregate();
        if (context.getDataServiceProvider().isInXTab() && ChartUIConstants.QUERY_CATEGORY.equals(queryType) && context.getModel() instanceof ChartWithAxes) {
          ((ChartWithAxes)context.getModel()).setTransposed(cmbDefinition.getSelectionIndex() > 0);
        }
      }
    }
);
    cmbDefinition.addModifyListener(this);
    cmbDefinition.addFocusListener(this);
    cmbDefinition.addKeyListener(this);
  }
 else {
    txtDefinition=new Text(cmpTop,SWT.BORDER | SWT.SINGLE);
    GridData gdTXTDefinition=new GridData(GridData.FILL_HORIZONTAL);
    gdTXTDefinition.widthHint=80;
    txtDefinition.setLayoutData(gdTXTDefinition);
    if (query != null && query.getDefinition() != null) {
      txtDefinition.setText(query.getDefinition());
      txtDefinition.setToolTipText(getTooltipForDataText(query.getDefinition()));
    }
    txtDefinition.addModifyListener(this);
    txtDefinition.addFocusListener(this);
    txtDefinition.addKeyListener(this);
  }
  Control dropControl=getInputControl();
  DropTarget target=new DropTarget(dropControl,DND.DROP_COPY);
  Transfer[] types=new Transfer[]{SimpleTextTransfer.getInstance()};
  target.setTransfer(types);
  target.addDropListener(new DataTextDropListener(dropControl));
  DataDefinitionTextManager.getInstance().addDataDefinitionText(dropControl,query);
  btnBuilder=new Button(cmpTop,SWT.PUSH);
{
    GridData gdBTNBuilder=new GridData();
    ChartUIUtil.setChartImageButtonSizeByPlatform(gdBTNBuilder);
    btnBuilder.setLayoutData(gdBTNBuilder);
    btnBuilder.setImage(UIHelper.getImage("String_Node_Str"));
    btnBuilder.addSelectionListener(this);
    btnBuilder.setToolTipText(Messages.getString("String_Node_Str"));
    btnBuilder.getImage().setBackground(btnBuilder.getBackground());
    btnBuilder.setEnabled(context.getUIServiceProvider().isInvokingSupported());
    btnBuilder.setVisible(context.getUIServiceProvider().isEclipseModeSupported());
  }
  if ((style & BUTTON_GROUP) == BUTTON_GROUP) {
    btnGroup=new Button(cmpTop,SWT.PUSH);
    GridData gdBTNGroup=new GridData();
    ChartUIUtil.setChartImageButtonSizeByPlatform(gdBTNGroup);
    btnGroup.setLayoutData(gdBTNGroup);
    btnGroup.setImage(UIHelper.getImage("String_Node_Str"));
    btnGroup.addSelectionListener(this);
    btnGroup.setToolTipText(Messages.getString("String_Node_Str"));
  }
  setColor();
  if (context.getDataServiceProvider().isInXTab() || context.getDataServiceProvider().isSharedBinding()) {
    if (txtDefinition != null) {
      txtDefinition.setEnabled(false);
    }
    btnBuilder.setEnabled(false);
    if (btnGroup != null) {
      btnGroup.setEnabled(false);
    }
  }
  return cmpTop;
}

Fixed version (ground truth):
public Composite createArea(Composite parent){
  int numColumns=2;
  if (description != null && description.length() > 0) {
    numColumns++;
  }
  if ((style & BUTTON_AGGREGATION) == BUTTON_AGGREGATION) {
    numColumns++;
  }
  if ((style & BUTTON_GROUP) == BUTTON_GROUP) {
    numColumns++;
  }
  cmpTop=new Composite(parent,SWT.NONE);
{
    GridLayout glContent=new GridLayout();
    glContent.numColumns=numColumns;
    glContent.marginHeight=0;
    glContent.marginWidth=0;
    glContent.horizontalSpacing=2;
    cmpTop.setLayout(glContent);
    GridData gd=new GridData(GridData.FILL_HORIZONTAL);
    cmpTop.setLayoutData(gd);
  }
  if (description != null && description.length() > 0) {
    Label lblDesc=new Label(cmpTop,SWT.NONE);
    lblDesc.setText(description);
    lblDesc.setToolTipText(tooltipWhenBlank);
  }
  if ((style & BUTTON_AGGREGATION) == BUTTON_AGGREGATION) {
    createAggregationItem(cmpTop);
  }
  Object[] predefinedQuery=context.getPredefinedQuery(queryType);
  if (predefinedQuery != null) {
    cmbDefinition=new Combo(cmpTop,context.getDataServiceProvider().isInXTab() ? SWT.READ_ONLY : SWT.NONE);
    GridData gd=new GridData(GridData.FILL_HORIZONTAL);
    cmbDefinition.setLayoutData(gd);
    if (predefinedQuery.length > 0) {
      populateExprComboItems(predefinedQuery);
    }
    initComboExprText();
    cmbDefinition.addListener(SWT.Selection,new Listener(){
      public void handleEvent(      Event event){
        query.setDefinition(getExpression(cmbDefinition));
        updateGroupingAggregate();
        if (context.getDataServiceProvider().isInXTab() && ChartUIConstants.QUERY_CATEGORY.equals(queryType) && context.getModel() instanceof ChartWithAxes) {
          ((ChartWithAxes)context.getModel()).setTransposed(cmbDefinition.getSelectionIndex() > 0);
        }
      }
    }
);
    cmbDefinition.addModifyListener(this);
    cmbDefinition.addFocusListener(this);
    cmbDefinition.addKeyListener(this);
  }
 else {
    txtDefinition=new Text(cmpTop,SWT.BORDER | SWT.SINGLE);
    GridData gdTXTDefinition=new GridData(GridData.FILL_HORIZONTAL);
    gdTXTDefinition.widthHint=80;
    txtDefinition.setLayoutData(gdTXTDefinition);
    if (query != null && query.getDefinition() != null) {
      txtDefinition.setText(query.getDefinition());
      txtDefinition.setToolTipText(getTooltipForDataText(query.getDefinition()));
    }
    txtDefinition.addModifyListener(this);
    txtDefinition.addFocusListener(this);
    txtDefinition.addKeyListener(this);
  }
  Control dropControl=getInputControl();
  DropTarget target=new DropTarget(dropControl,DND.DROP_COPY);
  Transfer[] types=new Transfer[]{SimpleTextTransfer.getInstance()};
  target.setTransfer(types);
  target.addDropListener(new DataTextDropListener(dropControl));
  DataDefinitionTextManager.getInstance().addDataDefinitionText(dropControl,query);
  btnBuilder=new Button(cmpTop,SWT.PUSH);
{
    GridData gdBTNBuilder=new GridData();
    ChartUIUtil.setChartImageButtonSizeByPlatform(gdBTNBuilder);
    btnBuilder.setLayoutData(gdBTNBuilder);
    btnBuilder.setImage(UIHelper.getImage("String_Node_Str"));
    btnBuilder.addSelectionListener(this);
    btnBuilder.setToolTipText(Messages.getString("String_Node_Str"));
    btnBuilder.getImage().setBackground(btnBuilder.getBackground());
    btnBuilder.setEnabled(context.getUIServiceProvider().isInvokingSupported());
    btnBuilder.setVisible(context.getUIServiceProvider().isEclipseModeSupported());
  }
  if ((style & BUTTON_GROUP) == BUTTON_GROUP) {
    btnGroup=new Button(cmpTop,SWT.PUSH);
    GridData gdBTNGroup=new GridData();
    ChartUIUtil.setChartImageButtonSizeByPlatform(gdBTNGroup);
    btnGroup.setLayoutData(gdBTNGroup);
    btnGroup.setImage(UIHelper.getImage("String_Node_Str"));
    btnGroup.addSelectionListener(this);
    btnGroup.setToolTipText(Messages.getString("String_Node_Str"));
  }
  setColor();
  if (context.getDataServiceProvider().isInXTab() || context.getDataServiceProvider().isSharedBinding()) {
    if (txtDefinition != null) {
      txtDefinition.setEnabled(false);
    }
    btnBuilder.setEnabled(false);
    if (btnGroup != null) {
      btnGroup.setEnabled(false);
    }
  }
  setTooltipForInputControl();
  return cmpTop;
}