Program: 71580
Project: 71580
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 CCombo(cmpTop,context.getDataServiceProvider().checkState(IDataServiceProvider.PART_CHART) ? SWT.READ_ONLY | SWT.BORDER : SWT.BORDER);
    GridData gd=new GridData(GridData.FILL_HORIZONTAL);
    gd.widthHint=80;
    gd.grabExcessHorizontalSpace=true;
    cmbDefinition.setLayoutData(gd);
    if (predefinedQuery.length > 0) {
      populateExprComboItems(predefinedQuery);
    }
 else     if (context.getDataServiceProvider().checkState(IDataServiceProvider.SHARE_QUERY)) {
      cmbDefinition.setEnabled(false);
    }
    cmbDefinition.addListener(SWT.Selection,new Listener(){
      public void handleEvent(      Event event){
        String oldQuery=query.getDefinition() == null ? "String_Node_Str" : query.getDefinition();
        if (cmbDefinition.getText().equals(oldQuery)) {
          return;
        }
        Object checkResult=context.getDataServiceProvider().checkData(queryType,cmbDefinition.getText());
        if (checkResult != null && checkResult instanceof Boolean) {
          if (!((Boolean)checkResult).booleanValue()) {
            WizardBase.showException(Messages.getString("String_Node_Str"));
            cmbDefinition.setText(oldQuery);
            return;
          }
 else {
            WizardBase.removeException();
          }
        }
        updateQuery(cmbDefinition.getText());
        if (!oldQuery.equals(cmbDefinition.getText()) && queryType == ChartUIConstants.QUERY_VALUE) {
          if (context.getDataServiceProvider().update(ChartUIConstants.QUERY_VALUE,cmbDefinition.getText())) {
            Event e=new Event();
            e.data=BaseDataDefinitionComponent.this;
            e.widget=cmbDefinition;
            e.type=IChartDataSheet.EVENT_QUERY;
            context.getDataSheet().notifyListeners(e);
          }
        }
        if (context.getDataServiceProvider().checkState(IDataServiceProvider.PART_CHART) && 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);
    initComboExprText();
  }
 else {
    txtDefinition=new Text(cmpTop,SWT.BORDER | SWT.SINGLE);
    GridData gdTXTDefinition=new GridData(GridData.FILL_HORIZONTAL);
    gdTXTDefinition.widthHint=80;
    gdTXTDefinition.grabExcessHorizontalSpace=true;
    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,this);
  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();
  IDataServiceProvider provider=context.getDataServiceProvider();
  boolean isCubeNoMultiDimensions=(provider.checkState(IDataServiceProvider.HAS_CUBE) || provider.checkState(IDataServiceProvider.SHARE_CROSSTAB_QUERY)) && !provider.checkState(IDataServiceProvider.MULTI_CUBE_DIMENSIONS);
  if (context.getDataServiceProvider().checkState(IDataServiceProvider.PART_CHART) || context.getDataServiceProvider().checkState(IDataServiceProvider.SHARE_QUERY)) {
    if (txtDefinition != null && !context.getDataServiceProvider().checkState(IDataServiceProvider.SHARE_CROSSTAB_QUERY)) {
      txtDefinition.setEnabled(false);
    }
    btnBuilder.setEnabled(false);
    if (btnGroup != null) {
      btnGroup.setEnabled(false);
    }
  }
  if (cmbDefinition != null && ChartUIConstants.QUERY_OPTIONAL.equals(queryType) && isCubeNoMultiDimensions) {
    cmbDefinition.setEnabled(false);
  }
  setTooltipForInputControl();
  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 CCombo(cmpTop,context.getDataServiceProvider().checkState(IDataServiceProvider.PART_CHART) ? SWT.READ_ONLY | SWT.BORDER : SWT.BORDER);
    GridData gd=new GridData(GridData.FILL_HORIZONTAL);
    gd.widthHint=80;
    gd.grabExcessHorizontalSpace=true;
    cmbDefinition.setLayoutData(gd);
    if (predefinedQuery.length > 0) {
      populateExprComboItems(predefinedQuery);
    }
 else     if (context.getDataServiceProvider().checkState(IDataServiceProvider.SHARE_QUERY)) {
      cmbDefinition.setEnabled(false);
    }
    cmbDefinition.addListener(SWT.Selection,new Listener(){
      public void handleEvent(      Event event){
        String oldQuery=query.getDefinition() == null ? "String_Node_Str" : query.getDefinition();
        if (cmbDefinition.getText().equals(oldQuery)) {
          return;
        }
        Object checkResult=context.getDataServiceProvider().checkData(queryType,cmbDefinition.getText());
        if (checkResult != null && checkResult instanceof Boolean) {
          if (!((Boolean)checkResult).booleanValue()) {
            WizardBase.showException(Messages.getString("String_Node_Str"));
            cmbDefinition.setText(oldQuery);
            return;
          }
 else {
            WizardBase.removeException();
          }
        }
        updateQuery(cmbDefinition.getText());
        if (!oldQuery.equals(cmbDefinition.getText()) && queryType == ChartUIConstants.QUERY_VALUE) {
          if (context.getDataServiceProvider().update(ChartUIConstants.QUERY_VALUE,cmbDefinition.getText())) {
            Event e=new Event();
            e.data=BaseDataDefinitionComponent.this;
            e.widget=cmbDefinition;
            e.type=IChartDataSheet.EVENT_QUERY;
            context.getDataSheet().notifyListeners(e);
          }
        }
        if (context.getDataServiceProvider().checkState(IDataServiceProvider.PART_CHART) && 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);
    initComboExprText();
  }
 else {
    txtDefinition=new Text(cmpTop,SWT.BORDER | SWT.SINGLE);
    GridData gdTXTDefinition=new GridData(GridData.FILL_HORIZONTAL);
    gdTXTDefinition.widthHint=80;
    gdTXTDefinition.grabExcessHorizontalSpace=true;
    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,this);
  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();
  IDataServiceProvider provider=context.getDataServiceProvider();
  boolean isCubeNoMultiDimensions=(provider.checkState(IDataServiceProvider.HAS_CUBE) || provider.checkState(IDataServiceProvider.SHARE_CROSSTAB_QUERY)) && !provider.checkState(IDataServiceProvider.MULTI_CUBE_DIMENSIONS);
  if (context.getDataServiceProvider().checkState(IDataServiceProvider.PART_CHART) || context.getDataServiceProvider().checkState(IDataServiceProvider.SHARE_QUERY)) {
    if (txtDefinition != null && !context.getDataServiceProvider().checkState(IDataServiceProvider.SHARE_CROSSTAB_QUERY)) {
      txtDefinition.setEnabled(false);
    }
    btnBuilder.setEnabled(false);
    if (btnGroup != null) {
      btnGroup.setEnabled(false);
    }
  }
  if (cmbDefinition != null && ChartUIConstants.QUERY_OPTIONAL.equals(queryType) && isCubeNoMultiDimensions) {
    cmbDefinition.setEnabled(false);
    btnBuilder.setEnabled(false);
  }
  setTooltipForInputControl();
  return cmpTop;
}