nus-yam/ex-repair huggingface dataset:
Program: 67166
Project: 67166
Buggy source:
/** 
 * Gets the aggregation function expression
 * @param orthoSD
 * @param strBaseAggExp
 * @throws ChartException 
 * @since BIRT 2.3
 */
public static String getAggregateFunctionExpr(SeriesDefinition orthoSD,String strBaseAggExp,Query orthQuery) throws ChartException {
  String strOrthoAgg=null;
  SeriesGrouping grouping=orthoSD.getGrouping();
  if (orthQuery != null && orthQuery.getGrouping() != null && orthQuery.getGrouping().isEnabled()) {
    strOrthoAgg=orthQuery.getGrouping().getAggregateExpression();
  }
 else   if (grouping != null && grouping.isEnabled()) {
    strOrthoAgg=grouping.getAggregateExpression();
  }
  if (strBaseAggExp == null && strOrthoAgg != null) {
    IAggregateFunction aFunc=PluginSettings.instance().getAggregateFunction(strOrthoAgg);
    if (aFunc.getType() != IAggregateFunction.RUNNING_AGGR) {
      strOrthoAgg=null;
    }
  }
  if (strOrthoAgg == null || "String_Node_Str".equals(strOrthoAgg)) {
    strOrthoAgg=strBaseAggExp;
  }
  return strOrthoAgg;
}

Fixed version (ground truth):
/** 
 * Gets the aggregation function expression
 * @param orthoSD
 * @param strBaseAggExp
 * @throws ChartException 
 * @since BIRT 2.3
 */
public static String getAggregateFunctionExpr(SeriesDefinition orthoSD,String strBaseAggExp,Query orthQuery) throws ChartException {
  String strOrthoAgg=null;
  SeriesGrouping grouping=orthoSD.getGrouping();
  if (orthQuery != null && orthQuery.getGrouping() != null && orthQuery.getGrouping().isEnabled()) {
    strOrthoAgg=orthQuery.getGrouping().getAggregateExpression();
  }
 else   if (grouping != null && grouping.isEnabled()) {
    strOrthoAgg=grouping.getAggregateExpression();
  }
  if (strBaseAggExp == null && strOrthoAgg != null) {
    IAggregateFunction aFunc=PluginSettings.instance().getAggregateFunction(strOrthoAgg);
    if (aFunc != null && aFunc.getType() != IAggregateFunction.RUNNING_AGGR) {
      strOrthoAgg=null;
    }
  }
  if (strOrthoAgg == null || "String_Node_Str".equals(strOrthoAgg)) {
    strOrthoAgg=strBaseAggExp;
  }
  return strOrthoAgg;
}
Program: 67167
Project: 67167
Buggy source:
private void convertSampleData(Axis axis,AxisType axisType){
  if ((axis.getAssociatedAxes() != null) && (axis.getAssociatedAxes().size() != 0)) {
    BaseSampleData bsd=chartModel.getSampleData().getBaseSampleData().get(0);
    bsd.setDataSetRepresentation(ChartUIUtil.getConvertedSampleDataRepresentation(axisType,bsd.getDataSetRepresentation(),0));
  }
 else {
    int iStartIndex=getFirstSeriesDefinitionIndexForAxis(axis);
    int iEndIndex=iStartIndex + axis.getSeriesDefinitions().size();
    int iOSDSize=chartModel.getSampleData().getOrthogonalSampleData().size();
    for (int i=0; i < iOSDSize; i++) {
      OrthogonalSampleData osd=chartModel.getSampleData().getOrthogonalSampleData().get(i);
      if (osd.getSeriesDefinitionIndex() >= iStartIndex && osd.getSeriesDefinitionIndex() < iEndIndex) {
        osd.setDataSetRepresentation(ChartUIUtil.getConvertedSampleDataRepresentation(axisType,osd.getDataSetRepresentation(),i));
      }
    }
  }
}

Fixed version (ground truth):
private void convertSampleData(Axis axis,AxisType axisType){
  if (chartModel.getSampleData() == null) {
    return;
  }
  if ((axis.getAssociatedAxes() != null) && (axis.getAssociatedAxes().size() != 0)) {
    BaseSampleData bsd=chartModel.getSampleData().getBaseSampleData().get(0);
    bsd.setDataSetRepresentation(ChartUIUtil.getConvertedSampleDataRepresentation(axisType,bsd.getDataSetRepresentation(),0));
  }
 else {
    int iStartIndex=getFirstSeriesDefinitionIndexForAxis(axis);
    int iEndIndex=iStartIndex + axis.getSeriesDefinitions().size();
    int iOSDSize=chartModel.getSampleData().getOrthogonalSampleData().size();
    for (int i=0; i < iOSDSize; i++) {
      OrthogonalSampleData osd=chartModel.getSampleData().getOrthogonalSampleData().get(i);
      if (osd.getSeriesDefinitionIndex() >= iStartIndex && osd.getSeriesDefinitionIndex() < iEndIndex) {
        osd.setDataSetRepresentation(ChartUIUtil.getConvertedSampleDataRepresentation(axisType,osd.getDataSetRepresentation(),i));
      }
    }
  }
}
Program: 67168
Project: 67168
Buggy source:
protected String[] getAllReportItemReferences(){
  List<ReportItemHandle> referenceList=itemHandle.getNamedDataBindingReferenceList();
  List<String> itemsWithName=new ArrayList<String>();
  for (int i=0; i < referenceList.size(); i++) {
    String qualfiedName=referenceList.get(i).getQualifiedName();
    if (qualfiedName != null && qualfiedName.length() > 0) {
      itemsWithName.add(qualfiedName);
    }
  }
  return itemsWithName.toArray(new String[itemsWithName.size()]);
}

Fixed version (ground truth):
protected String[] getAllReportItemReferences(){
  List<ReportItemHandle> referenceList=itemHandle.getNamedDataBindingReferenceList();
  List<String> itemsWithName=new ArrayList<String>();
  for (int i=0; i < referenceList.size(); i++) {
    ReportItemHandle itemhandle=referenceList.get(i);
    if (itemhandle.getCube() != null) {
      if (!ChartItemUtil.isChartHandle(itemhandle) && !ICrosstabConstants.CROSSTAB_EXTENSION_NAME.equals(((ExtendedItemHandle)itemhandle).getExtensionName())) {
        continue;
      }
    }
    String qualfiedName=itemhandle.getQualifiedName();
    if (qualfiedName != null && qualfiedName.length() > 0) {
      itemsWithName.add(qualfiedName);
    }
  }
  return itemsWithName.toArray(new String[itemsWithName.size()]);
}
Program: 67172
Project: 67172
Buggy source:
/** 
 * Gets all measure handles in the cube.
 * @param cube cube handle
 * @return all measure handles or empty list if no measure. The element inlist is <code>MeasureHandle</code>
 * @since 2.3
 */
@SuppressWarnings("String_Node_Str") public static List<MeasureHandle> getAllMeasures(CubeHandle cube){
  if (cube.getContentCount(ICubeModel.MEASURE_GROUPS_PROP) > 0) {
    List<MeasureHandle> measures=new ArrayList<MeasureHandle>();
    Iterator measureGroups=cube.getContents(ICubeModel.MEASURE_GROUPS_PROP).iterator();
    while (measureGroups.hasNext()) {
      MeasureGroupHandle measureGroup=(MeasureGroupHandle)measureGroups.next();
      measures.addAll(measureGroup.getContents(MeasureGroupHandle.MEASURES_PROP));
    }
    return measures;
  }
  return Collections.emptyList();
}

Fixed version (ground truth):
/** 
 * Gets all measure handles in the cube.
 * @param cube cube handle
 * @return all measure handles or empty list if no measure. The element inlist is <code>MeasureHandle</code>
 * @since 2.3
 */
@SuppressWarnings("String_Node_Str") public static List<MeasureHandle> getAllMeasures(CubeHandle cube){
  if (cube.getContentCount(ICubeModel.MEASURE_GROUPS_PROP) > 0) {
    List<MeasureHandle> measures=new ArrayList<MeasureHandle>();
    Iterator<?> measureGroups=cube.getContents(ICubeModel.MEASURE_GROUPS_PROP).iterator();
    while (measureGroups.hasNext()) {
      MeasureGroupHandle measureGroup=(MeasureGroupHandle)measureGroups.next();
      measures.addAll(measureGroup.getContents(MeasureGroupHandle.MEASURES_PROP));
    }
    return measures;
  }
  return Collections.emptyList();
}
Program: 67173
Project: 67173
Buggy source:
private static void initCellSize(AggregationCellHandle cell) throws BirtException {
  if (cell.getWidth() != null || cell.getWidth().getMeasure() == 0) {
    cell.getCrosstab().setColumnWidth(cell,DEFAULT_COLUMN_WIDTH);
  }
  if (cell.getHeight() != null || cell.getHeight().getMeasure() == 0) {
    cell.getCrosstab().setRowHeight(cell,DEFAULT_ROW_HEIGHT);
  }
}

Fixed version (ground truth):
private static void initCellSize(AggregationCellHandle cell) throws BirtException {
  if (cell.getWidth() == null || cell.getWidth().getMeasure() == 0) {
    cell.getCrosstab().setColumnWidth(cell,DEFAULT_COLUMN_WIDTH);
  }
  if (cell.getHeight() == null || cell.getHeight().getMeasure() == 0) {
    cell.getCrosstab().setRowHeight(cell,DEFAULT_ROW_HEIGHT);
  }
}
Program: 67174
Project: 67174
Buggy source:
public static Object getFirstContent(CrosstabCellHandle cell){
  if (cell != null) {
    List contents=cell.getContents();
    if (contents != null && contents.size() >= 1) {
      return contents.get(0);
    }
  }
  return null;
}

Fixed version (ground truth):
public static Object getFirstContent(CrosstabCellHandle cell){
  if (cell != null) {
    List<?> contents=cell.getContents();
    if (contents != null && contents.size() >= 1) {
      return contents.get(0);
    }
  }
  return null;
}
Program: 67175
Project: 67175
Buggy source:
public ScriptExpression adaptExpression(Expression expr,ExpressionLocation el){
  if (expr == null || expr.getStringExpression() == null)   return null;
  ScriptExpression jsExpr=null;
  if (ExpressionType.CONSTANT.equals(expr.getType())) {
    jsExpr=new ScriptExpression(JavascriptEvalUtil.transformToJsExpression(expr.getStringExpression()));
    jsExpr.setConstant(true);
    return jsExpr;
  }
 else   jsExpr=new ExpressionAdapter(expr,el);
  return jsExpr;
}

Fixed version (ground truth):
public ScriptExpression adaptExpression(Expression expr,ExpressionLocation el){
  if (expr == null || expr.getStringExpression() == null)   return null;
  ScriptExpression jsExpr=null;
  if (ExpressionType.CONSTANT.equals(expr.getType())) {
    jsExpr=new ScriptExpression(JavascriptEvalUtil.transformToJsExpression(expr.getStringExpression()));
    jsExpr.setConstant(true);
    jsExpr.setConstantValue(expr.getExpression());
    return jsExpr;
  }
 else   jsExpr=new ExpressionAdapter(expr,el);
  return jsExpr;
}
Program: 67176
Project: 67176
Buggy source:
/** 
 * @param dataSet
 * @throws BirtException
 */
private void doDefineDataSet(DataSetHandle dataSet) throws BirtException {
  if (dataSet instanceof JointDataSetHandle) {
    JointDataSetHandle jointDataSet=(JointDataSetHandle)dataSet;
    Iterator iter=((JointDataSetHandle)jointDataSet).dataSetsIterator();
    while (iter.hasNext()) {
      DataSetHandle childDataSet=(DataSetHandle)iter.next();
      if (childDataSet != null) {
        DataSourceHandle childDataSource=childDataSet.getDataSource();
        if (childDataSource != null) {
          doDefineDataSource(childDataSource);
        }
        doDefineDataSet(childDataSet);
      }
    }
  }
  dteSession.defineDataSet(this.appendRuntimeInfoToDataSet(dataSet,dteSession.getModelAdaptor().adaptDataSet(dataSet)));
}

Fixed version (ground truth):
/** 
 * @param dataSet
 * @throws BirtException
 */
private void doDefineDataSet(DataSetHandle dataSet) throws BirtException {
  if (dataSet instanceof JointDataSetHandle) {
    JointDataSetHandle jointDataSet=(JointDataSetHandle)dataSet;
    Iterator iter=((JointDataSetHandle)jointDataSet).dataSetsIterator();
    while (iter.hasNext()) {
      DataSetHandle childDataSet=(DataSetHandle)iter.next();
      if (childDataSet != null) {
        DataSourceHandle childDataSource=childDataSet.getDataSource();
        if (childDataSource != null) {
          doDefineDataSource(childDataSource);
        }
        doDefineDataSet(childDataSet);
      }
    }
  }
 else   if (dataSet instanceof DerivedDataSetHandle) {
    DerivedDataSetHandle handle=(DerivedDataSetHandle)dataSet;
    Iterator iter=handle.getInputDataSets().iterator();
    while (iter.hasNext()) {
      DataSetHandle childDataSet=(DataSetHandle)iter.next();
      if (childDataSet != null) {
        DataSourceHandle childDataSource=childDataSet.getDataSource();
        if (childDataSource != null) {
          doDefineDataSource(childDataSource);
        }
        doDefineDataSet(childDataSet);
      }
    }
  }
  dteSession.defineDataSet(this.appendRuntimeInfoToDataSet(dataSet,dteSession.getModelAdaptor().adaptDataSet(dataSet)));
}
Program: 67177
Project: 67177
Buggy source:
private Combo createExpressionValue(Composite parent){
  Combo expressionValue=new Combo(parent,SWT.None);
  expressionValue.addListener(SWT.Verify,expValueVerifyListener);
  expressionValue.addListener(SWT.Selection,expValueSelectionListener);
  Listener listener=new Listener(){
    public void handleEvent(    Event event){
      updateButtons();
    }
  }
;
  expressionValue.addListener(SWT.Modify,listener);
  IExpressionButton ceb=ChartExpressionButtonUtil.createExpressionButton(parent,expressionValue,(ExtendedItemHandle)designHandle,expressionProvider);
  ceb.addListener(listener);
  return expressionValue;
}

Fixed version (ground truth):
private Combo createExpressionValue(Composite parent){
  Combo expressionValue=new Combo(parent,SWT.None);
  expressionValue.addListener(SWT.Verify,expValueVerifyListener);
  expressionValue.addListener(SWT.Selection,expValueSelectionListener);
  Listener listener=new Listener(){
    public void handleEvent(    Event event){
      updateButtons();
    }
  }
;
  expressionValue.addListener(SWT.Modify,listener);
  IExpressionButton ceb=ChartExpressionButtonUtil.createExpressionButton(parent,expressionValue,(ExtendedItemHandle)designHandle,expressionProvider);
  ceb.addListener(listener);
  ceb.setPredefinedQuery(new String[]{CHOICE_SELECT_VALUE});
  return expressionValue;
}
Program: 67181
Project: 67181
Buggy source:
private int create2ValueComposite(Composite condition){
  if (expressionValue1 != null && !expressionValue1.isDisposed()) {
    return 0;
  }
  if (valueListComposite != null && !valueListComposite.isDisposed()) {
    valueListComposite.dispose();
    valueListComposite=null;
  }
  GridData expgd=new GridData();
  expgd.widthHint=100;
  expressionValue1=createExpressionValue(condition);
  expressionValue1.setLayoutData(expgd);
  expressionValue1.add(CHOICE_SELECT_VALUE);
  dummy1=createDummy(condition,3);
  andLable=new Label(condition,SWT.NONE);
  andLable.setText(Messages.getString("String_Node_Str"));
  andLable.setEnabled(false);
  andLable.setVisible(false);
  dummy2=createDummy(condition,3);
  expressionValue2=createExpressionValue(condition);
  expressionValue2.setLayoutData(expgd);
  expressionValue2.add(CHOICE_SELECT_VALUE);
  expressionValue2.setVisible(false);
  if (operator.getItemCount() > 0 && operator.getSelectionIndex() == -1) {
    operator.select(0);
  }
  condition.getParent().layout(true,true);
  return 1;
}

Fixed version (ground truth):
private int create2ValueComposite(Composite condition){
  if (expressionValue1 != null && !expressionValue1.isDisposed()) {
    return 0;
  }
  if (valueListComposite != null && !valueListComposite.isDisposed()) {
    valueListComposite.dispose();
    valueListComposite=null;
  }
  GridData expgd=new GridData();
  expgd.widthHint=100;
  expressionValue1=createExpressionValue(condition);
  expressionValue1.setLayoutData(expgd);
  dummy1=createDummy(condition,3);
  andLable=new Label(condition,SWT.NONE);
  andLable.setText(Messages.getString("String_Node_Str"));
  andLable.setEnabled(false);
  andLable.setVisible(false);
  dummy2=createDummy(condition,3);
  expressionValue2=createExpressionValue(condition);
  expressionValue2.setLayoutData(expgd);
  expressionValue2.setVisible(false);
  if (operator.getItemCount() > 0 && operator.getSelectionIndex() == -1) {
    operator.select(0);
  }
  condition.getParent().layout(true,true);
  return 1;
}
Program: 67182
Project: 67182
Buggy source:
private static void getBindings(Set<String> visited,Set<IDimLevel> aggOn,IBinding binding,List<IBinding> bindings) throws DataException, CoreException {
  if (visited.contains(binding.getBindingName())) {
    return;
  }
  List<String> currentVisitBindings=ExpressionCompilerUtil.extractColumnExpression(binding.getExpression(),ExpressionUtil.DATA_INDICATOR);
  currentVisitBindings.removeAll(visited);
  for (  String expr : ((List<String>)binding.getAggregatOns())) {
    aggOn.addAll(ExpressionUtil.getReferencedDimLevel(expr));
  }
  aggOn.addAll(ExpressionUtil.getReferencedDimLevel(((IScriptExpression)binding.getExpression()).getText()));
  visited.add(binding.getBindingName());
  for (  String bindingName : currentVisitBindings) {
    getBindings(visited,aggOn,getBinding(bindingName,bindings),bindings);
  }
}

Fixed version (ground truth):
private static void getBindings(Set<String> visited,Set<IDimLevel> aggOn,IBinding binding,List<IBinding> bindings) throws DataException, CoreException {
  if (binding == null || visited.contains(binding.getBindingName())) {
    return;
  }
  List<String> currentVisitBindings=ExpressionCompilerUtil.extractColumnExpression(binding.getExpression(),ExpressionUtil.DATA_INDICATOR);
  currentVisitBindings.removeAll(visited);
  for (  String expr : ((List<String>)binding.getAggregatOns())) {
    aggOn.addAll(ExpressionUtil.getReferencedDimLevel(expr));
  }
  aggOn.addAll(ExpressionUtil.getReferencedDimLevel(((IScriptExpression)binding.getExpression()).getText()));
  visited.add(binding.getBindingName());
  for (  String bindingName : currentVisitBindings) {
    getBindings(visited,aggOn,getBinding(bindingName,bindings),bindings);
  }
}
Program: 67184
Project: 67184
Buggy source:
public void setACLExpression(Expression expr) throws SemanticException {
  if (this.columnHintHandle != null)   columnHintHandle.setExpressionProperty(ColumnHint.ACL_EXPRESSION_MEMBER,expr);
 else   columnHint.setExpressionProperty(ColumnHint.ACL_EXPRESSION_MEMBER,expr);
}

Fixed version (ground truth):
public void setACLExpression(Expression expr) throws SemanticException {
  if (this.columnHintHandle != null)   columnHintHandle.setExpressionProperty(ColumnHint.ACL_EXPRESSION_MEMBER,expr);
 else   columnHint.setProperty(ColumnHint.ACL_EXPRESSION_MEMBER,expr);
}
Program: 67186
Project: 67186
Buggy source:
/** 
 * Renders chart and returns the drawable object in emitter
 * @param rowAdapter
 * @param externalContext
 * @param bEmpty
 * @return drawable object
 * @throws ChartException
 */
protected Object generateRenderObject(IDataRowExpressionEvaluator rowAdapter,BIRTExternalContext externalContext,boolean bEmpty) throws ChartException {
  prepareDeviceRenderer();
  GeneratedChartState gcs=buildChart(rowAdapter,externalContext);
  renderToImageFile(gcs);
  if (rtc.getSharedScale() != null && !rtc.getSharedScale().isShared()) {
    rtc.getSharedScale().setShared(true);
    ((ChartReportItemImpl)getReportItem(modelHandle)).setSharedScale(rtc.getSharedScale());
  }
  return getImageToDisplay();
}

Fixed version (ground truth):
protected Object generateRenderObject(IDataRowExpressionEvaluator rowAdapter,BIRTExternalContext externalContext,boolean bEmpty,IStyleProcessor externalProcessor) throws ChartException {
  if (externalProcessor == null) {
    externalProcessor=new ChartReportStyleProcessor(modelHandle,true,this.style,this.dpi);
  }
  prepareDeviceRenderer();
  GeneratedChartState gcs=buildChart(rowAdapter,externalContext,externalProcessor);
  renderToImageFile(gcs);
  if (rtc.getSharedScale() != null && !rtc.getSharedScale().isShared()) {
    rtc.getSharedScale().setShared(true);
    ((ChartReportItemImpl)getReportItem(modelHandle)).setSharedScale(rtc.getSharedScale());
  }
  return getImageToDisplay();
}
Program: 67188
Project: 67188
Buggy source:
protected GeneratedChartState buildChart(IDataRowExpressionEvaluator rowAdapter,BIRTExternalContext externalContext) throws ChartException {
  final Bounds bo=computeBounds();
  initializeRuntimeContext(rowAdapter,bo);
  GeneratedChartState gcs=Generator.instance().build(idr.getDisplayServer(),cm,bo,externalContext,rtc,new ChartReportStyleProcessor(modelHandle,true,this.style,this.dpi));
  boundsRuntime=gcs.getChartModel().getBlock().getBounds();
  return gcs;
}

Fixed version (ground truth):
protected GeneratedChartState buildChart(IDataRowExpressionEvaluator rowAdapter,BIRTExternalContext externalContext,IStyleProcessor externalProcessor) throws ChartException {
  final Bounds bo=computeBounds();
  initializeRuntimeContext(rowAdapter,bo);
  GeneratedChartState gcs=Generator.instance().build(idr.getDisplayServer(),cm,bo,externalContext,rtc,externalProcessor);
  boundsRuntime=gcs.getChartModel().getBlock().getBounds();
  return gcs;
}
Program: 67189
Project: 67189
Buggy source:
/** 
 * Gets if the values of the condition is(are) available.
 */
protected boolean checkValues(){
  if (valueVisible == 3) {
    if (valueList.size() <= 0) {
      return false;
    }
 else {
      return true;
    }
  }
 else {
    assert(!expressionValue1.isDisposed());
    assert(!expressionValue2.isDisposed());
    if (expressionValue1.getVisible()) {
      if (expressionValue1.getText() == null || expressionValue1.getText().trim().length() == 0) {
        return false;
      }
    }
    if (expressionValue2.getVisible()) {
      if (expressionValue2.getText() == null || expressionValue2.getText().trim().length() == 0) {
        return false;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Gets if the values of the condition is(are) available.
 */
protected boolean checkValues(){
  if (valueVisible == 3) {
    if (valueList.size() <= 0) {
      return false;
    }
 else {
      return true;
    }
  }
 else {
    assert(!expressionValue1.isDisposed());
    assert(!expressionValue2.isDisposed());
    if (expressionValue1 != null && expressionValue1.getVisible()) {
      if (expressionValue1.getText() == null || expressionValue1.getText().trim().length() == 0) {
        return false;
      }
    }
    if (expressionValue2 != null && expressionValue2.getVisible()) {
      if (expressionValue2.getText() == null || expressionValue2.getText().trim().length() == 0) {
        return false;
      }
    }
  }
  return true;
}
Program: 67191
Project: 67191
Buggy source:
protected void checkEditDelButtonStatus(){
  if (tableViewer == null) {
    return;
  }
  boolean enabled=(tableViewer.getSelection() == null) ? false : true;
  if (enabled == true && tableViewer.getSelection() instanceof StructuredSelection) {
    StructuredSelection selection=(StructuredSelection)tableViewer.getSelection();
    if (selection.toList().size() <= 0) {
      enabled=false;
    }
  }
  editBtn.setEnabled(enabled);
  delBtn.setEnabled(enabled);
  enabled=table.getItemCount() > 0 ? true : false;
  delAllBtn.setEnabled(enabled);
}

Fixed version (ground truth):
protected void checkEditDelButtonStatus(){
  if (tableViewer == null || table.isDisposed()) {
    return;
  }
  boolean enabled=(tableViewer.getSelection() == null) ? false : true;
  if (enabled == true && tableViewer.getSelection() instanceof StructuredSelection) {
    StructuredSelection selection=(StructuredSelection)tableViewer.getSelection();
    if (selection.toList().size() <= 0) {
      enabled=false;
    }
  }
  editBtn.setEnabled(enabled);
  delBtn.setEnabled(enabled);
  enabled=table.getItemCount() > 0 ? true : false;
  delAllBtn.setEnabled(enabled);
}
Program: 67192
Project: 67192
Buggy source:
protected void checkAddButtonStatus(){
  if (addExpressionValue != null) {
    String value=addExpressionValue.getText();
    if (value == null || value.length() == 0 || value.trim().length() == 0) {
      addBtn.setEnabled(false);
      return;
    }
    if (value != null) {
      value=value.trim();
    }
    if (valueList.indexOf(value) < 0) {
      addBtn.setEnabled(true);
    }
 else {
      addBtn.setEnabled(false);
    }
  }
}

Fixed version (ground truth):
protected void checkAddButtonStatus(){
  if (addExpressionValue != null && !addExpressionValue.isDisposed()) {
    String value=addExpressionValue.getText();
    if (value == null || value.length() == 0 || value.trim().length() == 0) {
      addBtn.setEnabled(false);
      return;
    }
    if (value != null) {
      value=value.trim();
    }
    if (valueList.indexOf(value) < 0) {
      addBtn.setEnabled(true);
    }
 else {
      addBtn.setEnabled(false);
    }
  }
}
Program: 67193
Project: 67193
Buggy source:
private int create2ValueComposite(Composite condition){
  if (expressionValue1 != null && !expressionValue1.isDisposed()) {
    return 0;
  }
  if (valueListComposite != null && !valueListComposite.isDisposed()) {
    valueListComposite.dispose();
    valueListComposite=null;
  }
  GridData expgd=new GridData();
  expgd.widthHint=100;
  expressionValue1=createExpressionValue(condition);
  expressionValue1.setLayoutData(expgd);
  expressionValue1.add(CHOICE_SELECT_VALUE);
  dummy1=createDummy(condition,3);
  andLable=new Label(condition,SWT.NONE);
  andLable.setText(Messages.getString("String_Node_Str"));
  andLable.setEnabled(false);
  dummy2=createDummy(condition,3);
  expressionValue2=createExpressionValue(condition);
  expressionValue2.setLayoutData(expgd);
  expressionValue2.add(CHOICE_SELECT_VALUE);
  if (operator.getItemCount() > 0 && operator.getSelectionIndex() == -1) {
    operator.select(0);
  }
  condition.getParent().layout(true,true);
  return 1;
}

Fixed version (ground truth):
private int create2ValueComposite(Composite condition){
  if (expressionValue1 != null && !expressionValue1.isDisposed()) {
    return 0;
  }
  if (valueListComposite != null && !valueListComposite.isDisposed()) {
    valueListComposite.dispose();
    valueListComposite=null;
  }
  GridData expgd=new GridData();
  expgd.widthHint=100;
  expressionValue1=createExpressionValue(condition);
  expressionValue1.setLayoutData(expgd);
  expressionValue1.add(CHOICE_SELECT_VALUE);
  dummy1=createDummy(condition,3);
  andLable=new Label(condition,SWT.NONE);
  andLable.setText(Messages.getString("String_Node_Str"));
  andLable.setEnabled(false);
  andLable.setVisible(false);
  dummy2=createDummy(condition,3);
  expressionValue2=createExpressionValue(condition);
  expressionValue2.setLayoutData(expgd);
  expressionValue2.add(CHOICE_SELECT_VALUE);
  expressionValue2.setVisible(false);
  if (operator.getItemCount() > 0 && operator.getSelectionIndex() == -1) {
    operator.select(0);
  }
  condition.getParent().layout(true,true);
  return 1;
}
Program: 67194
Project: 67194
Buggy source:
private void getDsMinMax(){
  PluginSettings ps=PluginSettings.instance();
  IDataSetProcessor iDSP=null;
  DataSet dst;
  EList<SeriesDefinition> el=((ChartWithoutAxes)getModel()).getSeriesDefinitions();
  ArrayList<Series> al=new ArrayList<Series>();
  ((ChartWithoutAxesImpl)getModel()).recursivelyGetSeries(el,al,0,0);
  final Series[] sea=al.toArray(new Series[al.size()]);
  for (int i=0; i < sea.length; i++) {
    try {
      iDSP=ps.getDataSetProcessor(sea[i].getClass());
      dst=sea[i].getDataSet();
      Double min=(Double)iDSP.getMinimum(dst);
      Double max=(Double)iDSP.getMaximum(dst);
      if (min != null && min < axisMin) {
        this.axisMin=min;
      }
      if (max != null && max > axisMax) {
        this.axisMax=max;
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
private void getDsMinMax(){
  PluginSettings ps=PluginSettings.instance();
  IDataSetProcessor iDSP=null;
  DataSet dst;
  EList<SeriesDefinition> el=((ChartWithoutAxes)getModel()).getSeriesDefinitions();
  ArrayList<Series> al=new ArrayList<Series>();
  ((ChartWithoutAxesImpl)getModel()).recursivelyGetSeries(el,al,0,0);
  final Series[] sea=al.toArray(new Series[al.size()]);
  for (int i=0; i < sea.length; i++) {
    try {
      iDSP=ps.getDataSetProcessor(sea[i].getClass());
      dst=sea[i].getDataSet();
      Double min=(Double)((Number)iDSP.getMinimum(dst)).doubleValue();
      Double max=(Double)((Number)iDSP.getMaximum(dst)).doubleValue();
      if (min != null && min < axisMin) {
        this.axisMin=min;
      }
      if (max != null && max > axisMax) {
        this.axisMax=max;
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}
Program: 67196
Project: 67196
Buggy source:
public void startForeign(IForeignContent foreign) throws BirtException {
  if (IForeignContent.HTML_TYPE.equalsIgnoreCase(foreign.getRawType())) {
    inForeign=true;
    boolean inlineBrother=!context.isFirstInline();
    context.endInline();
    HTML2Content.html2Content(foreign);
    context.startCell();
    if (context.isLastTable()) {
      wordWriter.insertHiddenParagraph();
    }
    wordWriter.startTable(foreign.getComputedStyle(),context.getCurrentWidth());
    wordWriter.startTableRow(-1);
    wordWriter.startTableCell(context.getCurrentWidth(),foreign.getComputedStyle(),null);
    writeToc(foreign);
    contentVisitor.visitChildren(foreign,null);
    adjustInline();
    wordWriter.endTableCell(context.needEmptyP());
    context.endCell();
    wordWriter.endTableRow();
    wordWriter.endTable();
    context.setLastIsTable(true);
    context.addContainer(true);
    hasPInside=false;
    if (inlineBrother) {
      context.startInline();
    }
    inForeign=false;
  }
 else {
    Object rawValue=foreign.getRawValue();
    String text=rawValue == null ? "String_Node_Str" : rawValue.toString();
    writeContent(DocEmitterImpl.NORMAL,text,foreign);
  }
}

Fixed version (ground truth):
public void startForeign(IForeignContent foreign) throws BirtException {
  if (IForeignContent.HTML_TYPE.equalsIgnoreCase(foreign.getRawType())) {
    inForeign=true;
    boolean inlineBrother=!context.isFirstInline();
    context.endInline();
    HTML2Content.html2Content(foreign);
    context.startCell();
    if (context.isLastTable()) {
      wordWriter.insertHiddenParagraph();
    }
    int width=WordUtil.convertTo(foreign.getWidth(),context.getCurrentWidth(),reportDpi);
    width=Math.min(width,context.getCurrentWidth());
    wordWriter.startTable(foreign.getComputedStyle(),width);
    wordWriter.startTableRow(-1);
    wordWriter.startTableCell(width,foreign.getComputedStyle(),null);
    writeToc(foreign);
    contentVisitor.visitChildren(foreign,null);
    adjustInline();
    wordWriter.endTableCell(context.needEmptyP());
    context.endCell();
    wordWriter.endTableRow();
    wordWriter.endTable();
    context.setLastIsTable(true);
    context.addContainer(true);
    hasPInside=false;
    if (inlineBrother) {
      context.startInline();
    }
    inForeign=false;
  }
 else {
    Object rawValue=foreign.getRawValue();
    String text=rawValue == null ? "String_Node_Str" : rawValue.toString();
    writeContent(DocEmitterImpl.NORMAL,text,foreign);
  }
}
Program: 67199
Project: 67199
Buggy source:
public int getColId(){
  return colId;
}

Fixed version (ground truth):
public int getColId(){
  if (status == CELL_SPANED) {
    Cell cell=getCell();
    if (cell != null) {
      return cell.getColId();
    }
  }
  return colId;
}
Program: 67200
Project: 67200
Buggy source:
public int getRowId(){
  return rowId;
}

Fixed version (ground truth):
public int getRowId(){
  if (status == CELL_SPANED) {
    Cell cell=getCell();
    if (cell != null) {
      return cell.getRowId();
    }
  }
  return rowId;
}
Program: 67201
Project: 67201
Buggy source:
public ListBandRenderFigure(){
  setLayoutManager(new ReportFlowLayout(){
    protected Dimension getChildSize(    IFigure child,    int wHint,    int hHint){
      if (child instanceof TableFigure) {
        IFigure grandFigure=getParent().getParent();
        if (grandFigure instanceof ListFigure && ((ListFigure)grandFigure).isDirty()) {
          int oldWidth=getBounds().width;
          int oldHeight=getBounds().height;
          int width=wHint + getInsets().getWidth();
          int height=hHint + getInsets().getHeight();
          if (width != oldWidth || height != oldHeight) {
            if (child instanceof TableFigure) {
              IFigure tablePane=((LayeredPane)((LayeredPane)((TableFigure)child).getContents()).getLayer(LayerConstants.PRINTABLE_LAYERS)).getLayer(LayerConstants.PRIMARY_LAYER);
              LayoutManager layoutManager=tablePane.getLayoutManager();
              if (layoutManager instanceof TableLayout) {
                ((ListFigure)grandFigure).markDirty(false);
                ((TableLayout)layoutManager).markDirty();
                getBounds().width=width;
                getBounds().height=height;
                tablePane.validate();
                getBounds().width=oldWidth;
                getBounds().height=oldHeight;
              }
            }
          }
        }
      }
      return super.getChildSize(child,wHint,hHint);
    }
  }
);
  setBorder(new MarginBorder(margin));
}

Fixed version (ground truth):
public ListBandRenderFigure(){
  setLayoutManager(new ReportFlowLayout(){
    protected Dimension getChildSize(    IFigure child,    int wHint,    int hHint){
      if (child instanceof TableFigure) {
        IFigure grandFigure=getParent().getParent();
        if (grandFigure instanceof ListFigure && ((ListFigure)grandFigure).isDirty()) {
          int oldWidth=getBounds().width;
          int oldHeight=getBounds().height;
          int width=wHint + getInsets().getWidth();
          int height=hHint + getInsets().getHeight();
          if (width != oldWidth || height != oldHeight) {
            if (child instanceof TableFigure) {
              IFigure tablePane=((LayeredPane)((LayeredPane)((TableFigure)child).getContents()).getLayer(LayerConstants.PRINTABLE_LAYERS)).getLayer(LayerConstants.PRIMARY_LAYER);
              LayoutManager layoutManager=tablePane.getLayoutManager();
              if (layoutManager instanceof TableLayout && !(getParent().getParent().getParent() instanceof ListBandRenderFigure)) {
                ((ListFigure)grandFigure).markDirty(false);
                ((TableLayout)layoutManager).markDirty();
                getBounds().width=width;
                getBounds().height=height;
                tablePane.validate();
                getBounds().width=oldWidth;
                getBounds().height=oldHeight;
              }
            }
          }
        }
      }
      return super.getChildSize(child,wHint,hHint);
    }
  }
);
  setBorder(new MarginBorder(margin));
}
Program: 67202
Project: 67202
Buggy source:
protected Dimension getChildSize(IFigure child,int wHint,int hHint){
  if (child instanceof TableFigure) {
    IFigure grandFigure=getParent().getParent();
    if (grandFigure instanceof ListFigure && ((ListFigure)grandFigure).isDirty()) {
      int oldWidth=getBounds().width;
      int oldHeight=getBounds().height;
      int width=wHint + getInsets().getWidth();
      int height=hHint + getInsets().getHeight();
      if (width != oldWidth || height != oldHeight) {
        if (child instanceof TableFigure) {
          IFigure tablePane=((LayeredPane)((LayeredPane)((TableFigure)child).getContents()).getLayer(LayerConstants.PRINTABLE_LAYERS)).getLayer(LayerConstants.PRIMARY_LAYER);
          LayoutManager layoutManager=tablePane.getLayoutManager();
          if (layoutManager instanceof TableLayout) {
            ((ListFigure)grandFigure).markDirty(false);
            ((TableLayout)layoutManager).markDirty();
            getBounds().width=width;
            getBounds().height=height;
            tablePane.validate();
            getBounds().width=oldWidth;
            getBounds().height=oldHeight;
          }
        }
      }
    }
  }
  return super.getChildSize(child,wHint,hHint);
}

Fixed version (ground truth):
protected Dimension getChildSize(IFigure child,int wHint,int hHint){
  if (child instanceof TableFigure) {
    IFigure grandFigure=getParent().getParent();
    if (grandFigure instanceof ListFigure && ((ListFigure)grandFigure).isDirty()) {
      int oldWidth=getBounds().width;
      int oldHeight=getBounds().height;
      int width=wHint + getInsets().getWidth();
      int height=hHint + getInsets().getHeight();
      if (width != oldWidth || height != oldHeight) {
        if (child instanceof TableFigure) {
          IFigure tablePane=((LayeredPane)((LayeredPane)((TableFigure)child).getContents()).getLayer(LayerConstants.PRINTABLE_LAYERS)).getLayer(LayerConstants.PRIMARY_LAYER);
          LayoutManager layoutManager=tablePane.getLayoutManager();
          if (layoutManager instanceof TableLayout && !(getParent().getParent().getParent() instanceof ListBandRenderFigure)) {
            ((ListFigure)grandFigure).markDirty(false);
            ((TableLayout)layoutManager).markDirty();
            getBounds().width=width;
            getBounds().height=height;
            tablePane.validate();
            getBounds().width=oldWidth;
            getBounds().height=oldHeight;
          }
        }
      }
    }
  }
  return super.getChildSize(child,wHint,hHint);
}
Program: 67204
Project: 67204
Buggy source:
/** 
 * Initializes some instance handles for query execution.
 * @throws ChartException
 */
public void initialize() throws ChartException {
  try {
    if (isReportDesignHandle()) {
      engine=(ReportEngine)new ReportEngineFactory().createReportEngine(new EngineConfig());
      engineTask=new ChartDummyEngineTask(engine,new ReportEngineHelper(engine).openReportDesign((ReportDesignHandle)itemHandle.getModuleHandle()),itemHandle.getModuleHandle());
      session=engineTask.getDataSession();
      engineTask.run();
    }
 else {
      DataSessionContext dsc=new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION,getReportDesignHandle());
      session=DataRequestSession.newSession(dsc);
    }
  }
 catch (  BirtException e) {
    if (engine == null && session != null) {
      session.shutdown();
    }
    if (engineTask != null) {
      engineTask.close();
    }
    throw new ChartException(ChartReportItemUIActivator.ID,ChartException.DATA_BINDING,e);
  }
}

Fixed version (ground truth):
/** 
 * Initializes some instance handles for query execution.
 * @throws ChartException
 */
public void initialize() throws ChartException {
  try {
    if (isReportDesignHandle()) {
      engine=(ReportEngine)new ReportEngineFactory().createReportEngine(new EngineConfig());
      engineTask=new ChartDummyEngineTask(engine,new ReportEngineHelper(engine).openReportDesign((ReportDesignHandle)itemHandle.getModuleHandle()),itemHandle.getModuleHandle());
      session=engineTask.getDataSession();
      engineTask.run();
      dteAdapter.setExecutionContext(engineTask.getExecutionContext());
    }
 else {
      DataSessionContext dsc=new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION,getReportDesignHandle());
      session=DataRequestSession.newSession(dsc);
    }
  }
 catch (  BirtException e) {
    if (engine == null && session != null) {
      session.shutdown();
    }
    if (engineTask != null) {
      engineTask.close();
    }
    throw new ChartException(ChartReportItemUIActivator.ID,ChartException.DATA_BINDING,e);
  }
}
Program: 67205
Project: 67205
Buggy source:
/** 
 * Updates cube bindings due to the change of cube set.
 * @return
 */
protected boolean updateCubeBindings(){
  boolean updated=false;
  try {
    CubeHandle cubeHandle=itemHandle.getCube();
    if (cubeHandle != null) {
      List<ComputedColumn> columnList=generateComputedColumns(cubeHandle);
      if (columnList.size() > 0) {
        List<String> bindingNameList=new ArrayList<String>();
        for (Iterator<ComputedColumnHandle> iter=itemHandle.columnBindingsIterator(); iter.hasNext(); ) {
          ComputedColumnHandle cch=iter.next();
          bindingNameList.add(cch.getName());
        }
        for (Iterator<ComputedColumn> iter=columnList.iterator(); iter.hasNext(); ) {
          ComputedColumn cc=iter.next();
          if (!bindingNameList.contains(cc.getName())) {
            DEUtil.addColumn(itemHandle,cc,false);
            updated=true;
          }
        }
      }
    }
  }
 catch (  SemanticException e) {
    ChartWizard.showException(ChartWizard.RepDSProvider_Cube_ID,e.getLocalizedMessage());
  }
  return updated;
}

Fixed version (ground truth):
/** 
 * Updates cube bindings due to the change of cube set.
 * @return
 */
protected boolean updateCubeBindings(){
  boolean updated=false;
  try {
    CubeHandle cubeHandle=itemHandle.getCube();
    if (cubeHandle != null) {
      List<ComputedColumn> columnList=ChartXTabUIUtil.generateComputedColumns(itemHandle,cubeHandle);
      if (columnList.size() > 0) {
        List<String> bindingNameList=new ArrayList<String>();
        for (Iterator<ComputedColumnHandle> iter=itemHandle.columnBindingsIterator(); iter.hasNext(); ) {
          ComputedColumnHandle cch=iter.next();
          bindingNameList.add(cch.getName());
        }
        for (Iterator<ComputedColumn> iter=columnList.iterator(); iter.hasNext(); ) {
          ComputedColumn cc=iter.next();
          if (!bindingNameList.contains(cc.getName())) {
            DEUtil.addColumn(itemHandle,cc,false);
            updated=true;
          }
        }
      }
    }
  }
 catch (  SemanticException e) {
    ChartWizard.showException(ChartWizard.RepDSProvider_Cube_ID,e.getLocalizedMessage());
  }
  return updated;
}
Program: 67206
Project: 67206
Buggy source:
private List<ComputedColumn> generateComputedColumns(CubeHandle cubeHandle){
  if (cubeHandle != null) {
    List<ComputedColumn> columnList=new ArrayList<ComputedColumn>();
    String exprType=UIUtil.getDefaultScriptType();
    IExpressionConverter exprConverter=ExpressionUtility.getExpressionConverter(exprType);
    for (    LevelHandle levelHandle : ChartCubeUtil.getAllLevels(cubeHandle)) {
      ComputedColumn column=StructureFactory.newComputedColumn(itemHandle,ChartCubeUtil.createLevelBindingName(levelHandle));
      column.setDataType(levelHandle.getDataType());
      column.setExpressionProperty(ComputedColumn.EXPRESSION_MEMBER,new Expression(exprConverter.getDimensionExpression(levelHandle.getContainer().getContainer().getName(),levelHandle.getName(),null),exprType));
      columnList.add(column);
      Iterator itLevelAttr=levelHandle.attributesIterator();
      while (itLevelAttr.hasNext()) {
        LevelAttributeHandle laHandle=(LevelAttributeHandle)itLevelAttr.next();
        ComputedColumn columnLA=StructureFactory.newComputedColumn(itemHandle,ChartCubeUtil.createLevelAttrBindingName(levelHandle,laHandle));
        columnLA.setDataType(laHandle.getDataType());
        columnLA.setExpressionProperty(ComputedColumn.EXPRESSION_MEMBER,new Expression(exprConverter.getDimensionExpression(levelHandle.getContainer().getContainer().getName(),levelHandle.getName(),laHandle.getName()),exprType));
        columnList.add(columnLA);
      }
    }
    for (    MeasureHandle measureHandle : ChartCubeUtil.getAllMeasures(cubeHandle)) {
      ComputedColumn column=StructureFactory.newComputedColumn(itemHandle,ChartCubeUtil.createMeasureBindingName(measureHandle));
      column.setDataType(measureHandle.getDataType());
      column.setExpressionProperty(ComputedColumn.EXPRESSION_MEMBER,new Expression(exprConverter.getMeasureExpression(measureHandle.getName()),exprType));
      column.setAggregateFunction(measureHandle.getFunction());
      columnList.add(column);
    }
    return columnList;
  }
  return Collections.emptyList();
}

Fixed version (ground truth):
/** 
 * Generate computed columns for the given report item with the closest data set available.
 * @param dataSetHandle Data Set. No aggregation created.
 * @return true if succeed,or fail if no column generated.
 * @see DataUtil#generateComputedColumns(ReportItemHandle)
 */
private List<ComputedColumn> generateComputedColumns(DataSetHandle dataSetHandle) throws SemanticException {
  if (dataSetHandle != null) {
    List<ResultSetColumnHandle> resultSetColumnList=DataUtil.getColumnList(dataSetHandle);
    List<ComputedColumn> columnList=new ArrayList<ComputedColumn>();
    for (    ResultSetColumnHandle resultSetColumn : resultSetColumnList) {
      ComputedColumn column=StructureFactory.newComputedColumn(itemHandle,resultSetColumn.getColumnName());
      column.setDataType(resultSetColumn.getDataType());
      ExpressionUtility.setBindingColumnExpression(resultSetColumn,column);
      columnList.add(column);
    }
    return columnList;
  }
  return Collections.emptyList();
}
Program: 67207
Project: 67207
Buggy source:
void setDataCube(String cubeName){
  try {
    boolean isPreviousDataBindingReference=false;
    if (itemHandle.getDataBindingType() == ReportItemHandle.DATABINDING_TYPE_REPORT_ITEM_REF) {
      isPreviousDataBindingReference=true;
      itemHandle.setDataBindingReference(null);
    }
    itemHandle.setDataSet(null);
    if (cubeName == null) {
      itemHandle.setCube(null);
      clearBindings();
    }
 else {
      if (!cubeName.equals(getDataCube()) || isPreviousDataBindingReference) {
        CubeHandle cubeHandle=getReportDesignHandle().findCube(cubeName);
        itemHandle.setCube(cubeHandle);
        clearBindings();
        generateBindings(generateComputedColumns(cubeHandle));
      }
    }
    ChartWizard.removeException(ChartWizard.RepDSProvider_Cube_ID);
  }
 catch (  SemanticException e) {
    ChartWizard.showException(ChartWizard.RepDSProvider_Cube_ID,e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
void setDataCube(String cubeName){
  try {
    boolean isPreviousDataBindingReference=false;
    if (itemHandle.getDataBindingType() == ReportItemHandle.DATABINDING_TYPE_REPORT_ITEM_REF) {
      isPreviousDataBindingReference=true;
      itemHandle.setDataBindingReference(null);
    }
    itemHandle.setDataSet(null);
    if (cubeName == null) {
      itemHandle.setCube(null);
      clearBindings();
    }
 else {
      if (!cubeName.equals(getDataCube()) || isPreviousDataBindingReference) {
        CubeHandle cubeHandle=getReportDesignHandle().findCube(cubeName);
        itemHandle.setCube(cubeHandle);
        clearBindings();
        generateBindings(ChartXTabUIUtil.generateComputedColumns(itemHandle,cubeHandle));
      }
    }
    ChartWizard.removeException(ChartWizard.RepDSProvider_Cube_ID);
  }
 catch (  SemanticException e) {
    ChartWizard.showException(ChartWizard.RepDSProvider_Cube_ID,e.getLocalizedMessage());
  }
}
Program: 67210
Project: 67210
Buggy source:
/** 
 * Disable/enable button to make all items in the dialog read-only.
 * @since 2.3
 */
private void updateButtonStatusForReadOnly(){
  if (fIsReadOnly) {
    btnAdd.setEnabled(false);
    btnEdit.setEnabled(false);
    btnDel.setEnabled(false);
    getAggregationButton().setEnabled(false);
    btnRefresh.setEnabled(false);
  }
}

Fixed version (ground truth):
/** 
 * Disable/enable button to make all items in the dialog read-only.
 * @since 2.3
 */
private void updateButtonStatusForReadOnly(){
  if (fIsReadOnly) {
    btnAdd.setEnabled(false);
    btnEdit.setEnabled(false);
    btnDel.setEnabled(false);
    getAggregationButton().setEnabled(false);
  }
}