nus-yam/ex-repair huggingface dataset:
Program: 68107
Project: 68107
Buggy source:
/** 
 * Check if Y grouping is enabled and current is using cube, only category expression is allowed as category sort key.
 * @return
 * @since BIRT 2.3
 */
protected boolean onlyCategoryExprAsCategorySortKey(){
  int stateInfo=wizardContext.getDataServiceProvider().getState();
  boolean isCube=(stateInfo & IDataServiceProvider.HAS_CUBE) == IDataServiceProvider.HAS_CUBE && (stateInfo & IDataServiceProvider.SHARE_QUERY) != IDataServiceProvider.SHARE_QUERY;
  if (isYGroupingEnabled() && !isCube) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Check if Y grouping is enabled and current is using cube, only category expression is allowed as category sort key.
 * @return
 * @since BIRT 2.3
 */
protected boolean onlyCategoryExprAsCategorySortKey(){
  return ChartUIUtil.hasLimitOnCategorySortKey(wizardContext);
}
Program: 68108
Project: 68108
Buggy source:
/** 
 * check if Y grouping is set.
 * @return
 * @since BIRT 2.3
 */
protected boolean isYGroupingEnabled(){
  SeriesDefinition baseSD=null;
  SeriesDefinition orthSD=null;
  Object[] orthAxisArray=null;
  Chart cm=wizardContext.getModel();
  if (cm instanceof ChartWithAxes) {
    ChartWithAxes cwa=(ChartWithAxes)cm;
    orthAxisArray=cwa.getOrthogonalAxes(cwa.getBaseAxes()[0],true);
    orthSD=(SeriesDefinition)((Axis)orthAxisArray[0]).getSeriesDefinitions().get(0);
  }
 else   if (cm instanceof ChartWithoutAxes) {
    ChartWithoutAxes cwoa=(ChartWithoutAxes)cm;
    baseSD=(SeriesDefinition)cwoa.getSeriesDefinitions().get(0);
    orthSD=(SeriesDefinition)baseSD.getSeriesDefinitions().get(0);
  }
  String yGroupExpr=null;
  if (orthSD != null && orthSD.getQuery() != null) {
    yGroupExpr=orthSD.getQuery().getDefinition();
  }
  return yGroupExpr != null && !"String_Node_Str".equals(yGroupExpr);
}

Fixed version (ground truth):
/** 
 * check if Y grouping is set.
 * @return
 * @since BIRT 2.3
 */
protected boolean isYGroupingEnabled(){
  return ChartUtil.isSpecifiedYOptionalExpression(wizardContext.getModel());
}
Program: 68111
Project: 68111
Buggy source:
public ImageData(IImageContent image,int styleId,int datatype,Image imageInfo,XlsContainer currentContainer,int heightDpi,int widthDpi){
  super();
  this.dataType=datatype;
  this.styleId=styleId;
  height=ExcelUtil.convertDimensionType(image.getHeight(),imageInfo.getHeight() * ExcelUtil.INCH_PT / heightDpi,heightDpi) / 1000;
  imageHeight=(int)height;
  int imageWidth=(int)ExcelUtil.convertDimensionType(image.getWidth(),imageInfo.getWidth() * ExcelUtil.INCH_PT / widthDpi,widthDpi);
  width=Math.min(currentContainer.getSizeInfo().getWidth(),imageWidth);
  altText=image.getAltText();
  imageUrl=image.getURI();
  this.imageData=imageInfo.getData();
  rowSpanInDesign=0;
  this.imageInfo=imageInfo;
}

Fixed version (ground truth):
public ImageData(IImageContent image,int styleId,int datatype,Image imageInfo,XlsContainer currentContainer,int heightDpi,int widthDpi){
  super();
  this.dataType=datatype;
  this.styleId=styleId;
  height=ExcelUtil.convertDimensionType(image.getHeight(),imageInfo.getHeight() * ExcelUtil.INCH_PT / heightDpi,heightDpi) / 1000;
  imageHeight=(int)height;
  int imageWidth=(int)ExcelUtil.convertDimensionType(image.getWidth(),imageInfo.getWidth() * 1000 * ExcelUtil.INCH_PT / widthDpi,widthDpi);
  width=Math.min(currentContainer.getSizeInfo().getWidth(),imageWidth);
  altText=image.getAltText();
  imageUrl=image.getURI();
  this.imageData=imageInfo.getData();
  rowSpanInDesign=0;
  this.imageInfo=imageInfo;
}
Program: 68112
Project: 68112
Buggy source:
private void init(String sTitle){
  display=Display.getDefault();
  if (shellParent == null) {
    shell=new Shell(display,SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL);
  }
 else {
    shell=new Shell(shellParent,SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL);
  }
  shell.setText(sTitle);
  shell.setSize(DEFAULT_WIDTH,DEFAULT_HEIGHT);
  shell.setLayout(new FillLayout());
  UIHelper.centerOnScreen(shell);
  placeComponents();
  shell.setDefaultButton(btnOK);
  shell.open();
  while (!shell.isDisposed()) {
    if (!display.readAndDispatch()) {
      display.sleep();
    }
  }
}

Fixed version (ground truth):
private void init(String sTitle){
  display=Display.getDefault();
  if (shellParent == null) {
    shell=new Shell(display,SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL);
  }
 else {
    shell=new Shell(shellParent,SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL);
  }
  shell.setText(sTitle);
  shell.setLayout(new GridLayout());
  placeComponents();
  UIHelper.centerOnScreen(shell);
  shell.setDefaultButton(btnOK);
  shell.open();
  while (!shell.isDisposed()) {
    if (!display.readAndDispatch()) {
      display.sleep();
    }
  }
}
Program: 68113
Project: 68113
Buggy source:
/** 
 */
private void toggleDetails(boolean bVisible){
  if (bVisible) {
    slDetails.topControl=grpDetails;
    shell.setSize(shell.getSize().x,MAX_HEIGHT);
  }
 else {
    slDetails.topControl=cmpDummy;
    shell.setSize(shell.getSize().x,DEFAULT_HEIGHT);
  }
  shell.layout();
}

Fixed version (ground truth):
/** 
 */
private void toggleDetails(boolean bVisible){
  if (bVisible) {
    slDetails.topControl=grpDetails;
    ((GridData)cmpDetails.getLayoutData()).heightHint=MAX_HEIGHT;
  }
 else {
    slDetails.topControl=cmpDummy;
    ((GridData)cmpDetails.getLayoutData()).heightHint=DEFAULT_HEIGHT;
  }
  shell.pack();
  shell.layout();
}
Program: 68116
Project: 68116
Buggy source:
public void endCell(ICellContent cell){
  engine.endCell();
}

Fixed version (ground truth):
public void endCell(ICellContent cell){
  engine.endCell(cell);
}
Program: 68118
Project: 68118
Buggy source:
public void addCell(ICellContent cellcontent,int col,int colSpan,int rowSpan,IStyle style){
  XlsTable table=tables.peek();
  ContainerSizeInfo cellSizeInfo=table.getColumnSizeInfo(col,colSpan);
  int diagonalNumber=cellcontent.getDiagonalNumber();
  StyleEntry cellStyleEntry=null;
  if (diagonalNumber != 0) {
    String diagonalColor=cellcontent.getDiagonalColor();
    String diagonalStyle=cellcontent.getDiagonalStyle();
    int diagonalWidth=PropertyUtil.getDimensionValue(cellcontent,cellcontent.getDiagonalWidth(),cellSizeInfo.getWidth());
    cellStyleEntry=engine.createCellEntry(cellSizeInfo,style,diagonalColor,diagonalStyle,diagonalWidth,getParentStyle());
  }
 else {
    cellStyleEntry=engine.createEntry(cellSizeInfo,style,getParentStyle());
  }
  XlsCell cell=new XlsCell(cellStyleEntry,cellSizeInfo,getCurrentContainer(),rowSpan);
  addContainer(cell);
}

Fixed version (ground truth):
public void addCell(ICellContent cellcontent,int col,int colSpan,int rowSpan,IStyle style){
  if (!isHidden(cellcontent)) {
    rowVisibilities.pop();
    rowVisibilities.push(true);
    XlsTable table=tables.peek();
    ContainerSizeInfo cellSizeInfo=table.getColumnSizeInfo(col,colSpan);
    int diagonalNumber=cellcontent.getDiagonalNumber();
    StyleEntry cellStyleEntry=null;
    if (diagonalNumber != 0) {
      String diagonalColor=cellcontent.getDiagonalColor();
      String diagonalStyle=cellcontent.getDiagonalStyle();
      int diagonalWidth=PropertyUtil.getDimensionValue(cellcontent,cellcontent.getDiagonalWidth(),cellSizeInfo.getWidth());
      cellStyleEntry=engine.createCellEntry(cellSizeInfo,style,diagonalColor,diagonalStyle,diagonalWidth,getParentStyle());
    }
 else {
      cellStyleEntry=engine.createEntry(cellSizeInfo,style,getParentStyle());
    }
    XlsCell cell=new XlsCell(cellStyleEntry,cellSizeInfo,getCurrentContainer(),rowSpan);
    addContainer(cell);
  }
}
Program: 68119
Project: 68119
Buggy source:
public void addRow(IStyle style){
  XlsContainer parent=getCurrentContainer();
  ContainerSizeInfo sizeInfo=parent.getSizeInfo();
  XlsContainer container=createContainer(sizeInfo,style,parent);
  container.setEmpty(false);
  addContainer(container);
}

Fixed version (ground truth):
public void addRow(IStyle style){
  rowVisibilities.push(false);
  XlsContainer parent=getCurrentContainer();
  ContainerSizeInfo sizeInfo=parent.getSizeInfo();
  XlsContainer container=createContainer(sizeInfo,style,parent);
  container.setEmpty(false);
  addContainer(container);
}
Program: 68120
Project: 68120
Buggy source:
public void endRow(float rowHeight){
  synchronize(rowHeight);
  endContainer();
}

Fixed version (ground truth):
public void endRow(float rowHeight){
  if (rowVisibilities.pop()) {
    synchronize(rowHeight);
  }
  endContainer();
}
Program: 68121
Project: 68121
Buggy source:
public void endCell(){
  endNormalContainer();
}

Fixed version (ground truth):
public void endCell(ICellContent cell){
  if (!isHidden(cell)) {
    endNormalContainer();
  }
}
Program: 68123
Project: 68123
Buggy source:
/** 
 * @param parent Parent composite to which the canvas is to be added
 * @param style SWT style for this composite
 * @param fdSelected FontDefinition instance that holds the font information to be displayed
 * @param cdSelected ColorDefinition instance that provides the foreground color for text to be displayed
 */
public FontCanvas(Composite parent,int style,FontDefinition fdSelected,ColorDefinition cdSelected,boolean bUseSize,boolean bUseColor,boolean bUseAlignment){
  super(parent,style);
  this.setSize(parent.getClientArea().x,parent.getClientArea().x);
  this.fdCurrent=fdSelected == null ? FontDefinitionImpl.createEmpty() : fdSelected;
  this.cdCurrent=cdSelected == null ? ColorDefinitionImpl.create(0,0,0) : cdSelected;
  this.bUseColor=bUseColor;
  this.bUseAlignment=bUseAlignment;
  this.bUseSize=bUseSize;
  try {
    idr=PluginSettings.instance().getDevice("String_Node_Str");
  }
 catch (  ChartException pex) {
    idr=null;
    WizardBase.displayException(pex);
  }
  addDisposeListener(this);
  addPaintListener(this);
  GC gc=new GC(this);
  Event e=new Event();
  e.gc=gc;
  notifyListeners(SWT.Paint,e);
}

Fixed version (ground truth):
/** 
 * @param parent Parent composite to which the canvas is to be added
 * @param style SWT style for this composite
 * @param fdSelected FontDefinition instance that holds the font information to be displayed
 * @param cdSelected ColorDefinition instance that provides the foreground color for text to be displayed
 */
public FontCanvas(Composite parent,int style,FontDefinition fdSelected,ColorDefinition cdSelected,boolean bUseSize,boolean bUseColor,boolean bUseAlignment){
  super(parent,style);
  this.setSize(parent.getClientArea().x,parent.getClientArea().x);
  this.fdCurrent=fdSelected == null ? FontDefinitionImpl.createEmpty() : fdSelected;
  this.cdCurrent=cdSelected;
  this.bUseColor=bUseColor;
  this.bUseAlignment=bUseAlignment;
  this.bUseSize=bUseSize;
  try {
    idr=PluginSettings.instance().getDevice("String_Node_Str");
  }
 catch (  ChartException pex) {
    idr=null;
    WizardBase.displayException(pex);
  }
  addDisposeListener(this);
  addPaintListener(this);
  GC gc=new GC(this);
  Event e=new Event();
  e.gc=gc;
  notifyListeners(SWT.Paint,e);
}
Program: 68124
Project: 68124
Buggy source:
/** 
 */
private void init(){
  this.setSize(getParent().getClientArea().width,getParent().getClientArea().height);
  vListeners=new Vector<Listener>();
}

Fixed version (ground truth):
/** 
 */
private void init(){
  if (Display.getCurrent().getHighContrast()) {
    GC gc=new GC(this);
    iSize=gc.getFontMetrics().getHeight() + 2;
  }
  this.setSize(getParent().getClientArea().width,getParent().getClientArea().height);
  vListeners=new Vector<Listener>();
}
Program: 68130
Project: 68130
Buggy source:
protected Composite getComponent(Composite parent){
  ChartUIUtil.bindHelp(parent,ChartHelpContextIds.POPUP_TEXT_FORMAT);
  cmpContent=new Composite(parent,SWT.NONE);
{
    GridLayout glMain=new GridLayout();
    glMain.marginHeight=7;
    glMain.marginWidth=7;
    cmpContent.setLayout(glMain);
  }
  if (axisType == AngleType.Z) {
    LabelAttributesContext attributesContext=new LabelAttributesContext();
    attributesContext.isPositionEnabled=false;
    attributesContext.isVisibilityEnabled=false;
    lacTitle=new LabelAttributesComposite(cmpContent,SWT.NONE,getContext(),attributesContext,Messages.getString("String_Node_Str"),getAxisForProcessing().getTitlePosition(),getAxisForProcessing().getTitle(),getChart().getUnits());
  }
 else {
    LabelAttributesContext attributesContext=new LabelAttributesContext();
    attributesContext.isVisibilityEnabled=false;
    lacTitle=new LabelAttributesComposite(cmpContent,SWT.NONE,getContext(),attributesContext,Messages.getString("String_Node_Str"),getAxisForProcessing().getTitlePosition(),getAxisForProcessing().getTitle(),getChart().getUnits(),getPositionScope());
  }
  GridData gdLACTitle=new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
  gdLACTitle.widthHint=200;
  lacTitle.setLayoutData(gdLACTitle);
  lacTitle.addListener(this);
  return cmpContent;
}

Fixed version (ground truth):
protected Composite getComponent(Composite parent){
  ChartUIUtil.bindHelp(parent,ChartHelpContextIds.POPUP_TEXT_FORMAT);
  cmpContent=new Composite(parent,SWT.NONE);
{
    GridLayout glMain=new GridLayout();
    glMain.marginHeight=7;
    glMain.marginWidth=7;
    cmpContent.setLayout(glMain);
  }
  if (axisType == AngleType.Z) {
    LabelAttributesContext attributesContext=new LabelAttributesContext();
    attributesContext.isPositionEnabled=false;
    attributesContext.isVisibilityEnabled=false;
    lacTitle=new LabelAttributesComposite(cmpContent,SWT.NONE,getContext(),attributesContext,Messages.getString("String_Node_Str"),getAxisForProcessing().getTitlePosition(),getAxisForProcessing().getTitle(),getChart().getUnits());
  }
 else {
    LabelAttributesContext attributesContext=new LabelAttributesContext();
    attributesContext.isVisibilityEnabled=false;
    lacTitle=new LabelAttributesComposite(cmpContent,SWT.NONE,getContext(),attributesContext,Messages.getString("String_Node_Str"),getAxisForProcessing().getTitlePosition(),getAxisForProcessing().getTitle(),getChart().getUnits(),getPositionScope());
  }
  GridData gdLACTitle=new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
  lacTitle.setLayoutData(gdLACTitle);
  lacTitle.addListener(this);
  return cmpContent;
}
Program: 68133
Project: 68133
Buggy source:
protected Composite getComponent(Composite parent){
  ChartUIUtil.bindHelp(parent,ChartHelpContextIds.POPUP_TEXT_FORMAT);
  GridLayout glContent=new GridLayout();
  glContent.marginHeight=7;
  glContent.marginWidth=7;
  cmpContent=new Composite(parent,SWT.NONE);
  cmpContent.setLayout(glContent);
  LabelAttributesContext attributesContext=new LabelAttributesContext();
  attributesContext.isFontAlignmentEnabled=false;
  lacTitle=new LabelAttributesComposite(cmpContent,SWT.NONE,getContext(),attributesContext,Messages.getString("String_Node_Str"),getSeriesForProcessing().getTitlePosition(),getLabel(),getChart().getUnits(),LabelAttributesComposite.ALLOW_HORIZONTAL_POSITION | LabelAttributesComposite.ALLOW_VERTICAL_POSITION);
  GridData gdLACTitle=new GridData(GridData.FILL_HORIZONTAL);
  gdLACTitle.widthHint=200;
  lacTitle.setLayoutData(gdLACTitle);
  lacTitle.addListener(this);
  return cmpContent;
}

Fixed version (ground truth):
protected Composite getComponent(Composite parent){
  ChartUIUtil.bindHelp(parent,ChartHelpContextIds.POPUP_TEXT_FORMAT);
  GridLayout glContent=new GridLayout();
  glContent.marginHeight=7;
  glContent.marginWidth=7;
  cmpContent=new Composite(parent,SWT.NONE);
  cmpContent.setLayout(glContent);
  LabelAttributesContext attributesContext=new LabelAttributesContext();
  attributesContext.isFontAlignmentEnabled=false;
  lacTitle=new LabelAttributesComposite(cmpContent,SWT.NONE,getContext(),attributesContext,Messages.getString("String_Node_Str"),getSeriesForProcessing().getTitlePosition(),getLabel(),getChart().getUnits(),LabelAttributesComposite.ALLOW_HORIZONTAL_POSITION | LabelAttributesComposite.ALLOW_VERTICAL_POSITION);
  GridData gdLACTitle=new GridData(GridData.FILL_HORIZONTAL);
  lacTitle.setLayoutData(gdLACTitle);
  lacTitle.addListener(this);
  return cmpContent;
}
Program: 68139
Project: 68139
Buggy source:
/** 
 * @param drillsRs
 */
private void updateStatus(List<IAggregationResultSet> drillsRs){
  for (int i=0; i < drillsRs.size(); i++) {
    IAggregationResultSet rs=(IAggregationResultSet)drillsRs.get(i);
    if (rs.getPosition() == rs.length() - 1) {
      this.statusForRs[i]=false;
    }
  }
}

Fixed version (ground truth):
/** 
 * @param drillsRs
 */
private void updateStatus(List<IAggregationResultSet> drillsRs){
  for (int i=0; i < drillsRs.size(); i++) {
    IAggregationResultSet rs=(IAggregationResultSet)drillsRs.get(i);
    if (rs.length() == 0 || rs.getPosition() == rs.length() - 1) {
      this.statusForRs[i]=false;
    }
  }
}
Program: 68140
Project: 68140
Buggy source:
public void save() throws IOException {
  fs.flush();
  fs.setRemoveOnExit(false);
}

Fixed version (ground truth):
public void save() throws IOException {
  fs.setRemoveOnExit(false);
  fs.flush();
}
Program: 68141
Project: 68141
Buggy source:
private void ensureFileOpened() throws IOException {
  if (rf != null) {
    return;
  }
  if (removeOnExit) {
synchronized (this) {
      if (rf == null) {
        ensureParentFolderCreated(fileName);
        rf=new RandomAccessFile(fileName,"String_Node_Str");
        rf.setLength(0);
      }
    }
  }
}

Fixed version (ground truth):
private void ensureFileOpened() throws IOException {
  if (rf != null) {
    return;
  }
synchronized (this) {
    if (rf == null) {
      ensureParentFolderCreated(fileName);
      rf=new RandomAccessFile(fileName,"String_Node_Str");
      rf.setLength(0);
    }
  }
}
Program: 68142
Project: 68142
Buggy source:
/** 
 * @return
 */
private final boolean isUniqueColumnName(){
  DataSetViewData[] items=DataSetProvider.getCurrentInstance().getColumns(((DataSetEditor)getContainer()).getHandle(),false,true,true);
  for (int i=0; i < items.length; i++) {
    if (!items[i].getName().equals(columnName)) {
      if (!items[i].isComputedColumn()) {
        if ((items[i].getAlias() != null && items[i].getAlias().equals(txtColumnName.getText())) || (items[i].getName() != null && items[i].getName().equals(txtColumnName.getText()))) {
          return false;
        }
      }
    }
  }
  Iterator iter=computedColumns.iterator();
  if (iter != null) {
    while (iter.hasNext()) {
      ComputedColumnHandle handle=(ComputedColumnHandle)iter.next();
      if (getStructure(getStructureOrHandle()) != handle.getStructure() && handle.getName().equals(txtColumnName.getText())) {
        return false;
      }
    }
  }
  Iterator iter2=((DataSetHandle)getContainer().getModel()).getPropertyHandle(DataSetHandle.COLUMN_HINTS_PROP).iterator();
  while (iter2.hasNext()) {
    ColumnHintHandle hint=(ColumnHintHandle)iter2.next();
    if (!hint.getColumnName().equals(columnName)) {
      if (txtColumnName.getText().equals(hint.getAlias()) || txtColumnName.getText().equals(hint.getColumnName())) {
        return false;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * @return
 */
private final boolean isUniqueColumnName(){
  DataSetViewData[] items=DataSetProvider.getCurrentInstance().getColumns(((DataSetEditor)getContainer()).getHandle(),true,true,true);
  for (int i=0; i < items.length; i++) {
    if (!items[i].getName().equals(columnName)) {
      if (!items[i].isComputedColumn()) {
        if ((items[i].getAlias() != null && items[i].getAlias().equals(txtColumnName.getText())) || (items[i].getName() != null && items[i].getName().equals(txtColumnName.getText()))) {
          return false;
        }
      }
    }
  }
  Iterator iter=computedColumns.iterator();
  if (iter != null) {
    while (iter.hasNext()) {
      ComputedColumnHandle handle=(ComputedColumnHandle)iter.next();
      if (getStructure(getStructureOrHandle()) != handle.getStructure() && handle.getName().equals(txtColumnName.getText())) {
        return false;
      }
    }
  }
  Iterator iter2=((DataSetHandle)getContainer().getModel()).getPropertyHandle(DataSetHandle.COLUMN_HINTS_PROP).iterator();
  while (iter2.hasNext()) {
    ColumnHintHandle hint=(ColumnHintHandle)iter2.next();
    if (!hint.getColumnName().equals(columnName)) {
      if (txtColumnName.getText().equals(hint.getAlias()) || txtColumnName.getText().equals(hint.getColumnName())) {
        return false;
      }
    }
  }
  return true;
}
Program: 68144
Project: 68144
Buggy source:
/** 
 * @param dataSetHandle
 * @param dataSetDesign
 * @param queryDefn
 * @return
 * @throws BirtException
 */
public IQueryResults execute(DataSetHandle dataSetHandle,IBaseDataSetDesign dataSetDesign,IQueryDefinition queryDefn,ExecutionContext context,DataRequestSession session) throws BirtException {
  if (!(dataSetHandle instanceof JointDataSetHandle || dataSetHandle instanceof DerivedDataSetHandle)) {
    if (dataSetHandle.getDataSource() != null) {
      session.defineDataSource(session.getModelAdaptor().adaptDataSource(dataSetHandle.getDataSource()));
    }
  }
  session.defineDataSet(dataSetDesign);
  IQueryResults resultSet=executeQuery(session,queryDefn);
  saveResultToDataItems(dataSetHandle,resultSet);
  return resultSet;
}

Fixed version (ground truth):
/** 
 * @param dataSetHandle
 * @param dataSetDesign
 * @param queryDefn
 * @return
 * @throws BirtException
 */
public IQueryResults execute(DataSetHandle dataSetHandle,IBaseDataSetDesign dataSetDesign,IQueryDefinition queryDefn,ExecutionContext context,DataRequestSession session) throws BirtException {
  if (!(dataSetHandle instanceof JointDataSetHandle || dataSetHandle instanceof DerivedDataSetHandle)) {
    if (dataSetHandle.getDataSource() != null) {
      session.defineDataSource(session.getModelAdaptor().adaptDataSource(dataSetHandle.getDataSource()));
    }
  }
 else {
    DefineDataSourceSetUtil.defineDataSourceAndDataSet(dataSetHandle,session);
  }
  session.defineDataSet(dataSetDesign);
  IQueryResults resultSet=executeQuery(session,queryDefn);
  saveResultToDataItems(dataSetHandle,resultSet);
  return resultSet;
}
Program: 68146
Project: 68146
Buggy source:
/** 
 * @param parent
 * @param index
 */
private void createComboBoxCell(Composite parent,final int index){
  Label label=ControlProvider.createLabel(parent,dialogLabels[index]);
  this.maxWidth=computeMaxWidth(label);
  cmbDataType=ControlProvider.createCombo(parent,SWT.READ_ONLY);
  cmbDataType.setLayoutData(ControlProvider.getGridDataWithHSpan(2));
  populateDataTypeComboItems();
  cmbDataType.select(Utility.findIndex(cmbDataType.getItems(),getTypeDisplayName((String)getProperty(getStructureOrHandle(),cellProperties[index]))));
  cmbDataType.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      validateSyntax();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * @param parent
 * @param index
 */
private void createComboBoxCell(Composite parent,final int index){
  Label label=ControlProvider.createLabel(parent,dialogLabels[index]);
  this.maxWidth=computeMaxWidth(label);
  cmbDataType=ControlProvider.createCombo(parent,SWT.READ_ONLY);
  cmbDataType.setLayoutData(ControlProvider.getGridDataWithHSpan(2));
  cmbDataType.setVisibleItemCount(30);
  populateDataTypeComboItems();
  cmbDataType.select(Utility.findIndex(cmbDataType.getItems(),getTypeDisplayName((String)getProperty(getStructureOrHandle(),cellProperties[index]))));
  cmbDataType.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      validateSyntax();
    }
  }
);
}
Program: 68147
Project: 68147
Buggy source:
/** 
 * @param parent
 * @param index
 */
private void createAggrListCell(final Composite parent,final int index){
  Label label=ControlProvider.createLabel(parent,dialogLabels[index]);
  this.maxWidth=computeMaxWidth(label);
  cmbAggregation=ControlProvider.createCombo(parent,SWT.READ_ONLY);
  cmbAggregation.setLayoutData(ControlProvider.getGridDataWithHSpan(2));
  cmbAggregation.add(BLANK);
  cmbAggregation.setData(BLANK,new Integer(0));
  for (int i=0; i < functions.length; i++) {
    cmbAggregation.add(functions[i].getDisplayName());
    cmbAggregation.setData(functions[i].getName(),new Integer(i + 1));
  }
  String aggrFuncName=(String)getProperty(getStructureOrHandle(),cellProperties[index]);
  int selectionIndex=getAggrFuncIndex(aggrFuncName);
  cmbAggregation.select(selectionIndex);
  cmbAggregation.setToolTipText(selectionIndex > 0 ? functions[selectionIndex - 1].getDescription() : BLANK);
  cmbAggregation.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      handleAggrSelectEvent(true);
      validateSyntax();
      updateFilterUIStatus();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * @param parent
 * @param index
 */
private void createAggrListCell(final Composite parent,final int index){
  Label label=ControlProvider.createLabel(parent,dialogLabels[index]);
  this.maxWidth=computeMaxWidth(label);
  cmbAggregation=ControlProvider.createCombo(parent,SWT.READ_ONLY);
  cmbAggregation.setLayoutData(ControlProvider.getGridDataWithHSpan(2));
  cmbAggregation.setVisibleItemCount(30);
  cmbAggregation.add(BLANK);
  cmbAggregation.setData(BLANK,new Integer(0));
  for (int i=0; i < functions.length; i++) {
    cmbAggregation.add(functions[i].getDisplayName());
    cmbAggregation.setData(functions[i].getName(),new Integer(i + 1));
  }
  String aggrFuncName=(String)getProperty(getStructureOrHandle(),cellProperties[index]);
  int selectionIndex=getAggrFuncIndex(aggrFuncName);
  cmbAggregation.select(selectionIndex);
  cmbAggregation.setToolTipText(selectionIndex > 0 ? functions[selectionIndex - 1].getDescription() : BLANK);
  cmbAggregation.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      handleAggrSelectEvent(true);
      validateSyntax();
      updateFilterUIStatus();
    }
  }
);
}
Program: 68148
Project: 68148
Buggy source:
private void createComboCellDataType(Composite parent,String label){
  ControlProvider.createLabel(parent,label);
  dataType=ControlProvider.createCombo(parent,SWT.READ_ONLY);
  dataType.setLayoutData(ControlProvider.getGridDataWithHSpan(2));
  if (structureHandle.getNativeDataType() != null && structureHandle.getNativeDataType() == -10) {
    dataType.setEnabled(false);
  }
 else {
    dataType.setItems(ParameterPageUtil.getDataTypeDisplayNames());
    dataType.select(Utility.findIndex(dataType.getItems(),ParameterPageUtil.getTypeDisplayName(structureHandle.getParameterDataType())));
    dataType.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        validateSyntax();
      }
    }
);
  }
}

Fixed version (ground truth):
private void createComboCellDataType(Composite parent,String label){
  ControlProvider.createLabel(parent,label);
  dataType=ControlProvider.createCombo(parent,SWT.READ_ONLY);
  dataType.setLayoutData(ControlProvider.getGridDataWithHSpan(2));
  dataType.setVisibleItemCount(30);
  if (structureHandle.getNativeDataType() != null && structureHandle.getNativeDataType() == -10) {
    dataType.setEnabled(false);
  }
 else {
    dataType.setItems(ParameterPageUtil.getDataTypeDisplayNames());
    dataType.select(Utility.findIndex(dataType.getItems(),ParameterPageUtil.getTypeDisplayName(structureHandle.getParameterDataType())));
    dataType.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        validateSyntax();
      }
    }
);
  }
}
Program: 68150
Project: 68150
Buggy source:
/** 
 * render series as curve.
 */
protected void renderAsCurve(IPrimitiveRenderer ipr,LineAttributes lia,ISeriesRenderingHints srh,Location[] loa,boolean bShowAsTape,double tapeWidth,Fill paletteEntry,boolean usePaletteLineColor) throws ChartException {
  final CurveRenderer cr=new CurveRenderer(((ChartWithAxes)getModel()),this,lia,loa,bShowAsTape,tapeWidth,true,!isDimension3D(),paletteEntry,usePaletteLineColor,((LineSeries)this.getSeries()).isConnectMissingValue());
  cr.draw(ipr);
}

Fixed version (ground truth):
/** 
 * render series as curve.
 */
protected void renderAsCurve(IPrimitiveRenderer ipr,LineAttributes lia,ISeriesRenderingHints srh,Location[] loa,boolean bShowAsTape,double tapeWidth,Fill paletteEntry,boolean usePaletteLineColor) throws ChartException {
  DataPointHints[] dpha=srh.getDataPoints();
  boolean bStacked=getSeries().isStacked() || getAxis().isPercent();
  LineSeries ls=(LineSeries)getSeries();
  DataPointsSeeker dpSeeker=DataPointsSeeker.create(dpha,ls,bStacked);
  List<Location> list=new LinkedList<Location>();
  while (dpSeeker.next()) {
    list.add(loa[dpSeeker.getIndex()]);
  }
  final CurveRenderer cr=new CurveRenderer(((ChartWithAxes)getModel()),this,lia,list.toArray(new Location[list.size()]),bShowAsTape,tapeWidth,true,!isDimension3D(),paletteEntry,usePaletteLineColor,((LineSeries)this.getSeries()).isConnectMissingValue());
  cr.draw(ipr);
}
Program: 68151
Project: 68151
Buggy source:
protected void refreshLinkedReportParamStatus(){
  TableItem items[]=viewer.getViewer().getTable().getItems();
  for (int i=0; i < items.length; i++) {
    if (items[i].getData() instanceof OdaDataSetParameterHandle) {
      OdaDataSetParameterHandle handle=(OdaDataSetParameterHandle)items[i].getData();
      if (handle.getParamName() == null) {
        continue;
      }
      ScalarParameterHandle reportParam=ParameterPageUtil.getScalarParameter(handle.getParamName(),true);
      if (reportParam != null) {
        if (DesignChoiceConstants.SCALAR_PARAM_TYPE_MULTI_VALUE.equals(reportParam.getParamType())) {
          getContainer().setMessage(Messages.getFormattedString("String_Node_Str",new Object[]{handle.getParamName(),handle.getName()}),IMessageProvider.ERROR);
        }
      }
 else {
        getContainer().setMessage(Messages.getFormattedString("String_Node_Str",new Object[]{handle.getParamName(),handle.getName()}),IMessageProvider.ERROR);
      }
      viewer.getViewer().refresh();
    }
  }
}

Fixed version (ground truth):
protected void refreshLinkedReportParamStatus(){
  TableItem items[]=viewer.getViewer().getTable().getItems();
  for (int i=0; i < items.length; i++) {
    if (items[i].getData() instanceof OdaDataSetParameterHandle) {
      OdaDataSetParameterHandle handle=(OdaDataSetParameterHandle)items[i].getData();
      if (handle.getParamName() == null) {
        continue;
      }
      ScalarParameterHandle reportParam=ParameterPageUtil.getScalarParameter(handle.getParamName(),true);
      if (reportParam != null) {
        if (DesignChoiceConstants.SCALAR_PARAM_TYPE_MULTI_VALUE.equals(reportParam.getParamType())) {
          getContainer().setMessage(Messages.getFormattedString("String_Node_Str",new Object[]{handle.getName()}),IMessageProvider.ERROR);
        }
      }
 else {
        getContainer().setMessage(Messages.getFormattedString("String_Node_Str",new Object[]{handle.getParamName(),handle.getName()}),IMessageProvider.ERROR);
      }
      viewer.getViewer().refresh();
    }
  }
}
Program: 68152
Project: 68152
Buggy source:
/** 
 * API test on IReportEngine.createGetParameterDefinitionTask( ) method
 */
public void testCreateGetParameterDefinitionTask(){
  try {
    ReportEngine engine=new ReportEngine(new EngineConfig());
    IReportRunnable runnable=engine.openReportDesign(REPORT_DESIGN);
    IGetParameterDefinitionTask paramDefnTask=engine.createGetParameterDefinitionTask(runnable);
    IParameterDefnBase paramDefn=paramDefnTask.getParameterDefn("String_Node_Str");
    assertTrue(paramDefn instanceof ScalarParameterDefn);
    assertTrue(IScalarParameterDefn.TEXT_BOX == paramDefn.getParameterType());
    assertTrue("String_Node_Str".equals(paramDefnTask.getDefaultValue(paramDefn)));
    ScalarParameterDefn scalarParameter=(ScalarParameterDefn)paramDefn;
    Map userProperties=scalarParameter.getUserPropertyValues();
    assertEquals(2,userProperties.size());
    assertEquals(5,userProperties.get("String_Node_Str"));
    assertEquals("String_Node_Str",userProperties.get("String_Node_Str"));
    assertEquals(5,scalarParameter.getUserPropertyValue("String_Node_Str"));
    assertEquals("String_Node_Str",scalarParameter.getUserPropertyValue("String_Node_Str"));
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    fail();
  }
}

Fixed version (ground truth):
/** 
 * API test on IReportEngine.createGetParameterDefinitionTask( ) method
 */
public void testCreateGetParameterDefinitionTask(){
  try {
    ReportEngine engine=new ReportEngine(new EngineConfig());
    IReportRunnable runnable=engine.openReportDesign(REPORT_DESIGN);
    IGetParameterDefinitionTask paramDefnTask=engine.createGetParameterDefinitionTask(runnable);
    IParameterDefnBase paramDefn=paramDefnTask.getParameterDefn("String_Node_Str");
    assertTrue(paramDefn instanceof ScalarParameterDefn);
    assertTrue(IScalarParameterDefn.TEXT_BOX == paramDefn.getParameterType());
    assertTrue("String_Node_Str".equals(paramDefnTask.getDefaultValue(paramDefn)));
    ScalarParameterDefn scalarParameter=(ScalarParameterDefn)paramDefn;
    Map userProperties=scalarParameter.getUserPropertyValues();
    assertEquals(2,userProperties.size());
    assertEquals(5,userProperties.get("String_Node_Str"));
    assertEquals("String_Node_Str",userProperties.get("String_Node_Str"));
    assertEquals("String_Node_Str",scalarParameter.getUserPropertyValue("String_Node_Str"));
    assertEquals("String_Node_Str",scalarParameter.getUserPropertyValue("String_Node_Str"));
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    fail();
  }
}
Program: 68153
Project: 68153
Buggy source:
public static String formatNumberAsDecimal(Object data){
  Number number=(Number)data;
  DecimalFormat numberFormat=new DecimalFormat("String_Node_Str");
  numberFormat.setMaximumFractionDigits(15);
  return numberFormat.format(number);
}

Fixed version (ground truth):
public static String formatNumberAsDecimal(Object data){
  Number number=(Number)data;
  DecimalFormat numberFormat=new DecimalFormat("String_Node_Str");
  numberFormat.setMaximumFractionDigits(15);
  updateExcelDecimalSeparator(numberFormat);
  return numberFormat.format(number);
}
Program: 68154
Project: 68154
Buggy source:
/** 
 * Provides a distinct color as far as possible.
 * @param paletteColor
 * @param paletteSize
 * @param index
 * @return
 */
private static ColorDefinition tunePaletteColor(ColorDefinition paletteColor,int paletteSize,int index){
  ColorDefinition color=goFactory.copyOf(paletteColor);
  int cycle=index / paletteSize;
  int offset=(cycle / 4) * 71;
  int phrase=cycle % 3;
switch (phrase) {
case 0:
    color.setRed((color.getRed() + offset) % 256);
  color.setGreen((color.getGreen() + offset) % 256);
break;
case 1:
color.setRed((color.getRed() + offset) % 256);
color.setBlue((color.getBlue() + offset) % 256);
break;
case 2:
color.setGreen((color.getGreen() + offset) % 256);
color.setBlue((color.getBlue() + offset) % 256);
break;
}
return color;
}

Fixed version (ground truth):
/** 
 * Provides a distinct color as far as possible.
 * @param paletteColor
 * @param paletteSize
 * @param index
 * @return
 */
private static ColorDefinition tunePaletteColor(ColorDefinition paletteColor,int paletteSize,int index){
  ColorDefinition color=goFactory.copyOf(paletteColor);
  int cycle=index / paletteSize;
  int offset=(cycle / 3 + 1) * 71;
  int phrase=cycle % 3;
switch (phrase) {
case 0:
    color.setRed((color.getRed() + offset) % 256);
  color.setGreen((color.getGreen() + offset) % 256);
break;
case 1:
color.setRed((color.getRed() + offset) % 256);
color.setBlue((color.getBlue() + offset) % 256);
break;
case 2:
color.setGreen((color.getGreen() + offset) % 256);
color.setBlue((color.getBlue() + offset) % 256);
break;
}
return color;
}
Program: 68156
Project: 68156
Buggy source:
private void createTypeArea(){
  ScrolledComposite sc=new ScrolledComposite(foSashForm,SWT.V_SCROLL);
{
    GridLayout layout=new GridLayout();
    sc.setLayout(layout);
    GridData gridData=new GridData(GridData.FILL_HORIZONTAL);
    sc.setLayoutData(gridData);
    sc.setExpandHorizontal(true);
    sc.setExpandVertical(true);
  }
  cmpType=new Composite(sc,SWT.NONE);
  cmpType.setLayout(new GridLayout(2,false));
  cmpType.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  sc.setContent(cmpType);
  createTypeTable();
  addChartTypes();
  createDetails();
  Point size=cmpType.computeSize(SWT.DEFAULT,SWT.DEFAULT);
  sc.setMinSize(size);
}

Fixed version (ground truth):
private void createTypeArea(){
  ScrolledComposite sc=new ScrolledComposite(foSashForm,SWT.V_SCROLL | SWT.H_SCROLL);
{
    GridLayout layout=new GridLayout();
    sc.setLayout(layout);
    GridData gridData=new GridData(GridData.FILL_HORIZONTAL);
    sc.setLayoutData(gridData);
    sc.setExpandHorizontal(true);
    sc.setExpandVertical(true);
  }
  cmpType=new Composite(sc,SWT.NONE);
  cmpType.setLayout(new GridLayout(2,false));
  cmpType.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  sc.setContent(cmpType);
  createTypeTable();
  addChartTypes();
  createDetails();
  Point size=cmpType.computeSize(SWT.DEFAULT,SWT.DEFAULT);
  sc.setMinSize(size);
}
Program: 68159
Project: 68159
Buggy source:
/** 
 * @param objClass
 * @return
 */
public static int getDataType(Class objClass){
  if (objClass.equals(byte[].class))   return typeCodes[6];
  for (int i=0; i < classes.length; i++) {
    if (classes[i].equals(objClass)) {
      return typeCodes[i];
    }
  }
  return UNKNOWN_TYPE;
}

Fixed version (ground truth):
/** 
 * @param objClass
 * @return
 */
public static int getDataType(Class objClass){
  if (objClass.equals(java.sql.Timestamp.class))   return typeCodes[4];
  if (objClass.equals(byte[].class))   return typeCodes[6];
  for (int i=0; i < classes.length; i++) {
    if (classes[i].equals(objClass)) {
      return typeCodes[i];
    }
  }
  return UNKNOWN_TYPE;
}
Program: 68161
Project: 68161
Buggy source:
/** 
 * Update column cache with clean the resultset property
 * @param dataSetHandle
 * @throws SemanticException
 */
public static void updateColumnCacheAfterCleanRs(DataSetHandle dataSetHandle) throws SemanticException {
  if (dataSetHandle instanceof OdaDataSetHandle) {
    if (dataSetHandle.getPropertyHandle(OdaDataSetHandle.RESULT_SET_PROP).isLocal())     dataSetHandle.getPropertyHandle(OdaDataSetHandle.RESULT_SET_PROP).setValue(new ArrayList());
  }
  updateColumnCache(dataSetHandle);
}

Fixed version (ground truth):
/** 
 * Update column cache with clean the resultset property
 * @param dataSetHandle
 * @throws SemanticException
 */
public static void updateColumnCacheAfterCleanRs(DataSetHandle dataSetHandle) throws SemanticException {
  if (dataSetHandle.getCachedMetaDataHandle() != null && dataSetHandle.getCachedMetaDataHandle().getResultSet() != null)   dataSetHandle.getCachedMetaDataHandle().getResultSet().clearValue();
  if (dataSetHandle instanceof OdaDataSetHandle) {
    if (dataSetHandle.getPropertyHandle(OdaDataSetHandle.RESULT_SET_PROP).isLocal())     dataSetHandle.getPropertyHandle(OdaDataSetHandle.RESULT_SET_PROP).setValue(new ArrayList());
  }
  updateColumnCache(dataSetHandle);
}
Program: 68162
Project: 68162
Buggy source:
/** 
 * Save the column meta data to data set handle.
 * @param dataSetHandle
 * @param holdEvent
 */
public static void updateColumnCache(DataSetHandle dataSetHandle,boolean holdEvent){
  try {
    if (dataSetHandle.getModuleHandle() instanceof ReportDesignHandle) {
      EngineConfig ec=new EngineConfig();
      ReportEngine engine=(ReportEngine)new ReportEngineFactory().createReportEngine(ec);
      ReportDesignHandle copy=(ReportDesignHandle)(dataSetHandle.getModuleHandle().copy().getHandle(null));
      DummyEngineTask engineTask=new DummyEngineTask(engine,new ReportEngineHelper(engine).openReportDesign(copy),copy);
      DataRequestSession session=engineTask.getDataSession();
      Map appContext=new HashMap();
      appContext.put(DataEngine.MEMORY_DATA_SET_CACHE,Integer.valueOf(dataSetHandle.getRowFetchLimit()));
      engineTask.setAppContext(appContext);
      engineTask.run();
      session.refreshMetaData(dataSetHandle,holdEvent);
      engineTask.close();
      engine.destroy();
    }
 else {
      DataSessionContext context=new DataSessionContext(DataEngineContext.DIRECT_PRESENTATION,dataSetHandle.getRoot(),null);
      DataRequestSession drSession=DataRequestSession.newSession(context);
      drSession.refreshMetaData(dataSetHandle,holdEvent);
      drSession.shutdown();
    }
  }
 catch (  BirtException ex) {
    logger.entering(DataSetUIUtil.class.getName(),"String_Node_Str",new Object[]{ex});
  }
}

Fixed version (ground truth):
/** 
 * Save the column meta data to data set handle.
 * @param dataSetHandle
 * @param holdEvent
 */
public static void updateColumnCache(DataSetHandle dataSetHandle,boolean holdEvent){
  try {
    if (dataSetHandle.getModuleHandle() instanceof ReportDesignHandle) {
      EngineConfig ec=new EngineConfig();
      ReportEngine engine=(ReportEngine)new ReportEngineFactory().createReportEngine(ec);
      ReportDesignHandle copy=(ReportDesignHandle)(dataSetHandle.getModuleHandle().copy().getHandle(null));
      DummyEngineTask engineTask=new DummyEngineTask(engine,new ReportEngineHelper(engine).openReportDesign(copy),copy);
      DataRequestSession session=engineTask.getDataSession();
      Map appContext=new HashMap();
      appContext.put(DataEngine.MEMORY_DATA_SET_CACHE,Integer.valueOf(dataSetHandle.getRowFetchLimit()));
      engineTask.setAppContext(appContext);
      engineTask.run();
      DataService.getInstance().registerSession(dataSetHandle,session);
      session.refreshMetaData(dataSetHandle,holdEvent);
      engineTask.close();
      engine.destroy();
    }
 else {
      DataSessionContext context=new DataSessionContext(DataEngineContext.DIRECT_PRESENTATION,dataSetHandle.getRoot(),null);
      DataRequestSession drSession=DataRequestSession.newSession(context);
      drSession.refreshMetaData(dataSetHandle,holdEvent);
      drSession.shutdown();
    }
  }
 catch (  BirtException ex) {
    logger.entering(DataSetUIUtil.class.getName(),"String_Node_Str",new Object[]{ex});
  }
}
Program: 68163
Project: 68163
Buggy source:
private boolean isTemp(String name){
  return (name.matches("String_Node_Str") || name.matches("String_Node_Str") || name.matches("String_Node_Str"));
}

Fixed version (ground truth):
private boolean isTemp(String name){
  return (name.matches("String_Node_Str") || name.matches("String_Node_Str") || name.matches("String_Node_Str")|| ExprMetaUtil.POS_NAME.equals(name));
}
Program: 68164
Project: 68164
Buggy source:
public final boolean isTickBwtweenCategories(){
  return bTickBwteenCategories;
}

Fixed version (ground truth):
public final boolean isTickBwtweenCategories(){
  return !bCategoryScale || bTickBwteenCategories;
}
Program: 68166
Project: 68166
Buggy source:
private boolean hasParameters(){
  ModuleHandle model=getModel();
  List parameters=model.getFlattenParameters();
  if (parameters != null) {
    for (    Object p : parameters) {
      if (p instanceof ParameterHandle && !((ParameterHandle)p).isHidden()) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean hasParameters(){
  IWebAppInfo webapp=WebViewer.getCurrentWebApp();
  if (webapp != null && webapp.useCustomParamHandling()) {
    return false;
  }
  ModuleHandle model=getModel();
  List parameters=model.getFlattenParameters();
  if (parameters != null) {
    for (    Object p : parameters) {
      if (p instanceof ParameterHandle && !((ParameterHandle)p).isHidden()) {
        return true;
      }
    }
  }
  return false;
}
Program: 68167
Project: 68167
Buggy source:
/** 
 */
private void init(){
  this.setSize(getParent().getClientArea().width,getParent().getClientArea().height);
  Display display=Display.getDefault();
  colorArray=this.createColorMap(display);
  vListeners=new Vector<Listener>();
}

Fixed version (ground truth):
/** 
 */
private void init(){
  if (Display.getCurrent().getHighContrast()) {
    GC gc=new GC(this);
    iSize=gc.getFontMetrics().getHeight() + 2;
  }
  this.setSize(getParent().getClientArea().width,getParent().getClientArea().height);
  Display display=Display.getDefault();
  colorArray=this.createColorMap(display);
  vListeners=new Vector<Listener>();
}
Program: 68168
Project: 68168
Buggy source:
/** 
 */
private void init(){
  this.setSize(getParent().getClientArea().width,getParent().getClientArea().height);
  vListeners=new Vector();
}

Fixed version (ground truth):
/** 
 */
private void init(){
  if (Display.getCurrent().getHighContrast()) {
    GC gc=new GC(this);
    iSize=gc.getFontMetrics().getHeight();
  }
  this.setSize(getParent().getClientArea().width,getParent().getClientArea().height);
  vListeners=new Vector();
}
Program: 68169
Project: 68169
Buggy source:
private void createDropDownComponent(int iXLoc,int iYLoc){
  if (!bEnabled) {
    return;
  }
  int shellWidth=this.getSize().x;
  Shell shell=new Shell(this.getShell(),SWT.NONE);
  shell.setLayout(new FillLayout(SWT.FILL));
  if ((getStyle() & SWT.RIGHT_TO_LEFT) != 0) {
    iXLoc-=shellWidth;
  }
  shell.setLocation(iXLoc,iYLoc);
  cmpDropDown=new Composite(shell,SWT.NONE);
  GridLayout gl=new GridLayout();
  gl.horizontalSpacing=0;
  gl.verticalSpacing=0;
  gl.marginHeight=0;
  gl.marginWidth=0;
  cmpDropDown.setLayout(gl);
  Listener listenerCmpDropDown=new Listener(){
    public void handleEvent(    Event event){
      handleEventCmpDropDown(event);
    }
  }
;
  cmpDropDown.addListener(SWT.KeyDown,listenerCmpDropDown);
  cmpDropDown.addListener(SWT.FocusOut,listenerCmpDropDown);
  final int choiceHigh=18;
  popupCanvases=new ICustomChoice[this.items.length];
  for (int iC=0; iC < items.length; iC++) {
    ICustomChoice cnv=createChoice(cmpDropDown,items[iC]);
    GridData gd=new GridData(GridData.FILL_HORIZONTAL);
    gd.heightHint=choiceHigh;
    cnv.setLayoutData(gd);
    cnv.addListener(SWT.MouseDown,canvasListener);
    cnv.addListener(SWT.MouseEnter,canvasListener);
    cnv.addListener(SWT.KeyDown,canvasListener);
    popupCanvases[iC]=cnv;
    if (cnvSelection.getValue().equals(cnv.getValue())) {
      cnv.notifyListeners(SWT.FocusIn,new Event());
      popupSelection=cnv;
    }
  }
  shell.setSize(shellWidth,choiceHigh * items.length);
  shell.layout();
  shell.open();
}

Fixed version (ground truth):
private void createDropDownComponent(int iXLoc,int iYLoc){
  if (!bEnabled) {
    return;
  }
  int shellWidth=this.getSize().x;
  Shell shell=new Shell(this.getShell(),SWT.NONE);
  shell.setLayout(new FillLayout(SWT.FILL));
  if ((getStyle() & SWT.RIGHT_TO_LEFT) != 0) {
    iXLoc-=shellWidth;
  }
  shell.setLocation(iXLoc,iYLoc);
  cmpDropDown=new Composite(shell,SWT.NONE);
  GridLayout gl=new GridLayout();
  gl.horizontalSpacing=0;
  gl.verticalSpacing=0;
  gl.marginHeight=0;
  gl.marginWidth=0;
  cmpDropDown.setLayout(gl);
  Listener listenerCmpDropDown=new Listener(){
    public void handleEvent(    Event event){
      handleEventCmpDropDown(event);
    }
  }
;
  cmpDropDown.addListener(SWT.KeyDown,listenerCmpDropDown);
  cmpDropDown.addListener(SWT.FocusOut,listenerCmpDropDown);
  popupCanvases=new ICustomChoice[this.items.length];
  for (int iC=0; iC < items.length; iC++) {
    ICustomChoice cnv=createChoice(cmpDropDown,items[iC]);
    GridData gd=new GridData(GridData.FILL_HORIZONTAL);
    gd.heightHint=itemHeight;
    cnv.setLayoutData(gd);
    cnv.addListener(SWT.MouseDown,canvasListener);
    cnv.addListener(SWT.MouseEnter,canvasListener);
    cnv.addListener(SWT.KeyDown,canvasListener);
    popupCanvases[iC]=cnv;
    if (cnvSelection.getValue().equals(cnv.getValue())) {
      cnv.notifyListeners(SWT.FocusIn,new Event());
      popupSelection=cnv;
    }
  }
  shell.setSize(shellWidth,itemHeight * items.length);
  shell.layout();
  shell.open();
}