nus-yam/ex-repair huggingface dataset:
Program: 71551
Project: 71551
Buggy source:
protected AbstractGuideHandle createGuideHandle(){
  TableGuideHandle handle=new TableGuideHandle(this);
  handle.setIndicatorLabel(getGuideLabel());
  handle.setIndicatorIcon(ProviderFactory.createProvider(getModel()).getNodeIcon(getModel()));
  return handle;
}

Fixed version (ground truth):
protected AbstractGuideHandle createGuideHandle(){
  TableGuideHandle handle=new TableGuideHandle(this);
  handle.setIndicatorLabel(getGuideLabel());
  INodeProvider provider=ProviderFactory.createProvider(getModel());
  handle.setIndicatorIcon(provider.getNodeIcon(getModel()));
  handle.setToolTip(ReportFigureUtilities.createToolTipFigure(provider.getNodeTooltip(getModel()),DesignChoiceConstants.BIDI_DIRECTION_LTR,DesignChoiceConstants.TEXT_ALIGN_LEFT));
  return handle;
}
Program: 71552
Project: 71552
Buggy source:
/** 
 * Returns the border style.
 * @param obj
 * @return
 */
protected int getBorderStyle(Object obj){
  Integer retValue=(Integer)(styleMap.get(obj));
  if (retValue == null) {
    return SWT.LINE_SOLID;
  }
  return retValue.intValue();
}

Fixed version (ground truth):
/** 
 * Returns the border style.
 * @param obj
 * @return
 */
protected int getBorderStyle(Object obj){
  Integer retValue=styleMap.get(obj);
  if (retValue == null) {
    return SWT.LINE_SOLID;
  }
  return retValue.intValue();
}
Program: 71553
Project: 71553
Buggy source:
/** 
 * Returns the border width as pixel.
 * @param obj
 * @return
 */
protected int getBorderWidth(Object obj){
  if (obj instanceof String) {
    String[] rt=DEUtil.splitString((String)obj);
    if (rt[0] != null && DEUtil.isValidNumber(rt[0])) {
      double w=DEUtil.convertoToPixel(new DimensionValue(Double.parseDouble(rt[0]),rt[1]));
      if (w <= EPS) {
        return 0;
      }
      return Math.max(1,(int)w);
    }
  }
  Integer retValue=(Integer)(widthMap.get(obj));
  if (retValue == null) {
    return 1;
  }
  return retValue.intValue();
}

Fixed version (ground truth):
/** 
 * Returns the border width as pixel.
 * @param obj
 * @return
 */
protected int getBorderWidth(Object obj){
  Integer retValue=widthMap.get(obj);
  if (retValue != null) {
    return retValue.intValue();
  }
  retValue=commonCacheWidthMap.get(obj);
  if (retValue != null) {
    return retValue.intValue();
  }
  if (obj instanceof String) {
    String[] rt=DEUtil.splitString((String)obj);
    if (rt[0] != null && DEUtil.isValidNumber(rt[0])) {
      double w=DEUtil.convertoToPixel(new DimensionValue(Double.parseDouble(rt[0]),rt[1]));
      if (w <= EPS) {
        return 0;
      }
      int cw=Math.max(1,(int)w);
      commonCacheWidthMap.put((String)obj,cw);
      return cw;
    }
  }
  return 1;
}
Program: 71555
Project: 71555
Buggy source:
protected Control createContents(Composite parent){
  ChartUIUtil.bindHelp(parent,ChartHelpContextIds.DIALOG_COLOR_GRADIENT);
  getShell().setText(Messages.getString("String_Node_Str"));
  getShell().setSize(420,320);
  UIHelper.centerOnScreen(getShell());
  return super.createContents(parent);
}

Fixed version (ground truth):
protected Control createContents(Composite parent){
  ChartUIUtil.bindHelp(parent,ChartHelpContextIds.DIALOG_COLOR_GRADIENT);
  getShell().setText(Messages.getString("String_Node_Str"));
  getShell().setSize(300,350);
  UIHelper.centerOnScreen(getShell());
  return super.createContents(parent);
}
Program: 71556
Project: 71556
Buggy source:
private void createRotationPanel(){
  GridLayout glRotation=new GridLayout();
  glRotation.verticalSpacing=2;
  glRotation.marginHeight=2;
  glRotation.marginWidth=2;
  glRotation.numColumns=3;
  Group grpRotation=new Group(cmpContent,SWT.NONE);
  GridData gdGRPRotation=new GridData(GridData.FILL_BOTH);
  gdGRPRotation.heightHint=180;
  grpRotation.setLayoutData(gdGRPRotation);
  grpRotation.setLayout(glRotation);
  grpRotation.setText(Messages.getString("String_Node_Str"));
  ascRotation=new AngleSelectorComposite(grpRotation,SWT.BORDER,(int)gCurrent.getDirection(),Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
  GridData gdASCRotation=new GridData(GridData.FILL_BOTH);
  gdASCRotation.horizontalSpan=1;
  gdASCRotation.verticalSpan=3;
  ascRotation.setLayoutData(gdASCRotation);
  ascRotation.setAngleChangeListener(this);
  iscRotation=new IntegerSpinControl(grpRotation,SWT.NONE,(int)gCurrent.getDirection());
  GridData gdISCRotation=new GridData(GridData.FILL_HORIZONTAL);
  gdISCRotation.horizontalSpan=2;
  iscRotation.setLayoutData(gdISCRotation);
  iscRotation.setMinimum(-90);
  iscRotation.setMaximum(90);
  iscRotation.setIncrement(1);
  iscRotation.addListener(this);
}

Fixed version (ground truth):
private void createRotationPanel(){
  GridLayout glRotation=new GridLayout();
  glRotation.verticalSpacing=2;
  glRotation.marginHeight=2;
  glRotation.marginWidth=2;
  Group grpRotation=new Group(cmpContent,SWT.NONE);
  GridData gdGRPRotation=new GridData(GridData.FILL_BOTH);
  gdGRPRotation.heightHint=180;
  grpRotation.setLayoutData(gdGRPRotation);
  grpRotation.setLayout(glRotation);
  grpRotation.setText(Messages.getString("String_Node_Str"));
  iscRotation=new IntegerSpinControl(grpRotation,SWT.NONE,(int)gCurrent.getDirection());
  GridData gdISCRotation=new GridData(GridData.FILL_HORIZONTAL);
  iscRotation.setLayoutData(gdISCRotation);
  iscRotation.setMinimum(-90);
  iscRotation.setMaximum(90);
  iscRotation.setIncrement(1);
  iscRotation.addListener(this);
  ascRotation=new AngleSelectorComposite(grpRotation,SWT.BORDER,(int)gCurrent.getDirection(),Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
  GridData gdASCRotation=new GridData(GridData.FILL_BOTH);
  gdASCRotation.verticalSpan=3;
  ascRotation.setLayoutData(gdASCRotation);
  ascRotation.setAngleChangeListener(this);
}
Program: 71557
Project: 71557
Buggy source:
public ParameterHelper(ScalarParameterHandle parameter,Locale locale,TimeZone timezone){
  this.distinct=parameter.distinct();
  this.labelColumnName=getLabelColumnName(parameter);
  this.valueColumnName=getValueColumnName(parameter);
  this.valueType=parameter.getDataType();
  this.fixedOrder=parameter.isFixedOrder();
  this.alreadySorted=parameter.getSortByColumn() != null;
  String pattern=parameter.getPattern();
  this.converter=new ReportParameterConverter(pattern,ULocale.forLocale(locale),timezone);
  if (!fixedOrder && !alreadySorted) {
    boolean sortDirectionValue="String_Node_Str".equalsIgnoreCase(parameter.getSortDirection());
    boolean sortByLabel="String_Node_Str".equalsIgnoreCase(parameter.getSortBy());
    Comparator choiceComparator=new SelectionChoiceComparator(sortByLabel,pattern,sortDirectionValue,ULocale.forLocale(locale));
    this.comparator=new DistinctComparatorDecorator(choiceComparator,distinct);
  }
}

Fixed version (ground truth):
public ParameterHelper(ScalarParameterHandle parameter,Locale locale,TimeZone timezone){
  this.distinct=parameter.distinct();
  this.labelColumnName=getLabelColumnName(parameter);
  this.valueColumnName=getValueColumnName(parameter);
  this.valueType=parameter.getDataType();
  this.fixedOrder=parameter.isFixedOrder();
  this.alreadySorted=parameter.getSortByColumn() != null;
  String pattern=parameter.getPattern();
  this.converter=new ReportParameterConverter(null,ULocale.forLocale(locale),timezone);
  if (!fixedOrder && !alreadySorted) {
    boolean sortDirectionValue="String_Node_Str".equalsIgnoreCase(parameter.getSortDirection());
    boolean sortByLabel="String_Node_Str".equalsIgnoreCase(parameter.getSortBy());
    Comparator choiceComparator=new SelectionChoiceComparator(sortByLabel,pattern,sortDirectionValue,ULocale.forLocale(locale));
    this.comparator=new DistinctComparatorDecorator(choiceComparator,distinct);
  }
}
Program: 71558
Project: 71558
Buggy source:
/** 
 * Save the column meta data to data set handle.
 * @param dataSetHandle
 * @param holdEvent
 */
public static void updateColumnCache(DataSetHandle dataSetHandle,boolean holdEvent){
  try {
    EngineConfig ec=new EngineConfig();
    ReportEngine engine=(ReportEngine)new ReportEngineFactory().createReportEngine(ec);
    DummyEngineTask engineTask=new DummyEngineTask(engine,new ReportEngineHelper(engine).openReportDesign((ReportDesignHandle)dataSetHandle.getModuleHandle()),dataSetHandle.getModuleHandle());
    DataRequestSession session=engineTask.getDataSession();
    Map appContext=new HashMap();
    appContext.put(DataEngine.MEMORY_DATA_SET_CACHE,new Integer(dataSetHandle.getRowFetchLimit()));
    engineTask.setAppContext(appContext);
    engineTask.run();
    session.refreshMetaData(dataSetHandle,holdEvent);
    engineTask.close();
    engine.destroy();
  }
 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);
      DummyEngineTask engineTask=new DummyEngineTask(engine,new ReportEngineHelper(engine).openReportDesign((ReportDesignHandle)dataSetHandle.getModuleHandle()),dataSetHandle.getModuleHandle());
      DataRequestSession session=engineTask.getDataSession();
      Map appContext=new HashMap();
      appContext.put(DataEngine.MEMORY_DATA_SET_CACHE,new Integer(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});
  }
}
Program: 71559
Project: 71559
Buggy source:
/** 
 * Prepare the binding for a query definition.
 * @param queryDefn
 * @return
 * @throws DataException
 */
public static IQueryDefinition populateBindings(IQueryDefinition queryDefn) throws DataException {
  try {
    List<String> reCalGroupNames=getReCalGroupNames(queryDefn,queryDefn.getQueryExecutionHints().getTargetGroupInstances());
    Iterator<IBinding> bindingIt=queryDefn.getBindings().values().iterator();
    while (bindingIt.hasNext()) {
      IBinding binding=bindingIt.next();
      if (binding.getAggregatOns().size() == 0 || !reCalGroupNames.contains(binding.getAggregatOns().get(0))) {
        if (binding.getExpression() instanceof IScriptExpression && binding.getAggrFunction() == null) {
          String text=((IScriptExpression)binding.getExpression()).getText();
          if (ExpressionUtil.getColumnName(text) != null || ExpressionUtil.getColumnBindingName(text) != null)           continue;
          if (referToRecAggrBinding(queryDefn,reCalGroupNames,text))           continue;
        }
        String expr=ExpressionUtil.createJSDataSetRowExpression(constructNonReCalBindingDataSetName(binding.getBindingName()));
        binding.setExpression(new ScriptExpression(expr));
        binding.getAggregatOns().clear();
        binding.setAggrFunction(null);
      }
    }
    return queryDefn;
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}

Fixed version (ground truth):
/** 
 * Prepare the binding for a query definition.
 * @param queryDefn
 * @return
 * @throws DataException
 */
public static IQueryDefinition populateBindings(IQueryDefinition queryDefn) throws DataException {
  try {
    List<String> reCalGroupNames=getReCalGroupNames(queryDefn,queryDefn.getQueryExecutionHints().getTargetGroupInstances());
    Iterator<IBinding> bindingIt=queryDefn.getBindings().values().iterator();
    while (bindingIt.hasNext()) {
      IBinding binding=bindingIt.next();
      if (binding.getAggregatOns().size() == 0 || !reCalGroupNames.contains(binding.getAggregatOns().get(0))) {
        if (binding.getExpression() instanceof IScriptExpression && binding.getAggrFunction() == null) {
          String text=((IScriptExpression)binding.getExpression()).getText();
          if (ExpressionUtil.getColumnName(text) != null || ExpressionUtil.getColumnBindingName(text) == null)           continue;
          if (!referToRecAggrBinding(queryDefn,reCalGroupNames,text))           continue;
        }
        String expr=ExpressionUtil.createJSDataSetRowExpression(constructNonReCalBindingDataSetName(binding.getBindingName()));
        binding.setExpression(new ScriptExpression(expr));
        binding.getAggregatOns().clear();
        binding.setAggrFunction(null);
      }
    }
    return queryDefn;
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}
Program: 71560
Project: 71560
Buggy source:
protected IResultIterator executeOdiQuery(IEventHandler eventHandler,StopSign stopSign) throws DataException {
  try {
    RDLoad rdLoad=RDUtil.newLoad(engine.getSession().getTempDir(),engine.getContext(),new QueryResultInfo(realBasedQueryID,null,-1));
    DataSetResultSet dataSetResult=rdLoad.loadDataSetData();
    StreamManager manager=new StreamManager(engine.getContext(),new QueryResultInfo(queryDefn.getQueryResultsID(),null,0));
    if (PLSUtil.isPLSEnabled(queryDefn) && PLSUtil.needUpdateDataSet(queryDefn,manager)) {
      populatePLSDataSetData(eventHandler,stopSign,manager);
      dataSetResult.close();
      rdLoad=RDUtil.newLoad(engine.getSession().getTempDir(),engine.getContext(),new QueryResultInfo(realBasedQueryID,null,-1));
      dataSetResult=rdLoad.loadDataSetData();
    }
    IResultClass meta=dataSetResult.getResultClass();
    IResultIterator resultIterator=new CachedResultSet(query,populateResultClass(meta),dataSetResult,eventHandler,engine.getSession(),stopSign);
    dataSetResult.close();
    return resultIterator;
  }
 catch (  IOException e) {
    throw new DataException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
protected IResultIterator executeOdiQuery(IEventHandler eventHandler,StopSign stopSign) throws DataException {
  try {
    RDLoad rdLoad=RDUtil.newLoad(engine.getSession().getTempDir(),engine.getContext(),new QueryResultInfo(realBasedQueryID,null,-1));
    DataSetResultSet dataSetResult=rdLoad.loadDataSetData();
    StreamManager manager=new StreamManager(engine.getContext(),new QueryResultInfo(queryDefn.getQueryResultsID(),null,0));
    if (PLSUtil.isPLSEnabled(queryDefn) && PLSUtil.needUpdateDataSet(queryDefn,manager)) {
      if (engine.getContext().getDocWriter() != null) {
        populatePLSDataSetData(eventHandler,stopSign,manager);
        dataSetResult.close();
        rdLoad=RDUtil.newLoad(engine.getSession().getTempDir(),engine.getContext(),new QueryResultInfo(realBasedQueryID,null,-1));
        dataSetResult=rdLoad.loadDataSetData();
      }
 else {
        org.eclipse.birt.data.engine.impl.document.ResultIterator docIt=new org.eclipse.birt.data.engine.impl.document.ResultIterator(engine.getSession().getTempDir(),engine.getContext(),null,queryDefn.getQueryResultsID());
        PLSEnabledDataSetPopulator populator=new PLSEnabledDataSetPopulator(queryDefn,queryDefn.getQueryExecutionHints().getTargetGroupInstances(),docIt);
        IResultIterator resultIterator=new CachedResultSet(query,populateResultClass(populator.getResultClass()),populator,eventHandler,engine.getSession(),stopSign);
        dataSetResult.close();
        return resultIterator;
      }
    }
    IResultClass meta=dataSetResult.getResultClass();
    IResultIterator resultIterator=new CachedResultSet(query,populateResultClass(meta),dataSetResult,eventHandler,engine.getSession(),stopSign);
    dataSetResult.close();
    return resultIterator;
  }
 catch (  IOException e) {
    throw new DataException(e.getLocalizedMessage());
  }
}
Program: 71561
Project: 71561
Buggy source:
/** 
 * Directly drop stream
 * @param streamPath
 */
public void dropStream(String streamPath){
  if (writer != null)   writer.dropStream(streamPath);
}

Fixed version (ground truth):
/** 
 * Directly drop stream
 * @param streamPath
 */
public void dropStream(String streamPath){
  if (writer != null) {
    try {
      OutputStream stream=writer.createRandomAccessStream(streamPath);
      stream.close();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
}
Program: 71562
Project: 71562
Buggy source:
protected IResultIterator executeOdiQuery(IEventHandler eventHandler,StopSign stopSign) throws DataException {
  RDLoad rdLoad=RDUtil.newLoad(engine.getSession().getTempDir(),engine.getContext(),new QueryResultInfo(realBasedQueryID,null,-1));
  DataSetResultSet dataSetResult=rdLoad.loadDataSetData();
  IResultClass meta=dataSetResult.getResultClass();
  IResultIterator resultIterator=null;
  if (PLSUtil.isPLSEnabled(queryDefn)) {
    org.eclipse.birt.data.engine.impl.document.ResultIterator docIt=new org.eclipse.birt.data.engine.impl.document.ResultIterator(engine.getSession().getTempDir(),engine.getContext(),null,queryDefn.getQueryResultsID());
    PLSEnabledDataSetPopulator populator=new PLSEnabledDataSetPopulator(queryDefn,queryDefn.getQueryExecutionHints().getTargetGroupInstances(),docIt);
    resultIterator=new CachedResultSet(query,populateResultClass(populator.getResultClass()),populator,eventHandler,engine.getSession(),stopSign);
  }
 else {
    resultIterator=new CachedResultSet(query,populateResultClass(meta),dataSetResult,eventHandler,engine.getSession(),stopSign);
  }
  dataSetResult.close();
  return resultIterator;
}

Fixed version (ground truth):
protected IResultIterator executeOdiQuery(IEventHandler eventHandler,StopSign stopSign) throws DataException {
  try {
    RDLoad rdLoad=RDUtil.newLoad(engine.getSession().getTempDir(),engine.getContext(),new QueryResultInfo(realBasedQueryID,null,-1));
    DataSetResultSet dataSetResult=rdLoad.loadDataSetData();
    StreamManager manager=new StreamManager(engine.getContext(),new QueryResultInfo(queryDefn.getQueryResultsID(),null,0));
    if (PLSUtil.isPLSEnabled(queryDefn) && PLSUtil.needUpdateDataSet(queryDefn,manager)) {
      populatePLSDataSetData(eventHandler,stopSign,manager);
      dataSetResult.close();
      rdLoad=RDUtil.newLoad(engine.getSession().getTempDir(),engine.getContext(),new QueryResultInfo(realBasedQueryID,null,-1));
      dataSetResult=rdLoad.loadDataSetData();
    }
    IResultClass meta=dataSetResult.getResultClass();
    IResultIterator resultIterator=new CachedResultSet(query,populateResultClass(meta),dataSetResult,eventHandler,engine.getSession(),stopSign);
    dataSetResult.close();
    return resultIterator;
  }
 catch (  IOException e) {
    throw new DataException(e.getLocalizedMessage());
  }
}
Program: 71563
Project: 71563
Buggy source:
public void handleEvent(Event event){
switch (event.type) {
case SWT.Selection:
    cnvCells.selectColumn(btnHeaders.indexOf(event.widget));
  break;
case SWT.KeyDown:
if (event.keyCode == SWT.ARROW_LEFT || event.keyCode == SWT.ARROW_RIGHT) {
  scrollTable(cnvCells.getHorizontalBar(),event);
}
 else if (event.keyCode == SWT.ARROW_UP || event.keyCode == SWT.ARROW_DOWN) {
  scrollTable(cnvCells.getVerticalBar(),event);
}
break;
case SWT.FocusIn:
iColumnIndex=btnHeaders.indexOf(event.widget);
Event newEvent=new Event();
newEvent.widget=event.widget;
newEvent.type=FOCUS_IN;
newEvent.data=new Integer(iColumnIndex);
fireEvent(newEvent);
break;
}
}

Fixed version (ground truth):
public void handleEvent(Event event){
switch (event.type) {
case SWT.Selection:
    cnvCells.selectColumn(btnHeaders.indexOf(event.widget));
  break;
case SWT.FocusIn:
iColumnIndex=btnHeaders.indexOf(event.widget);
Event newEvent=new Event();
newEvent.widget=event.widget;
newEvent.type=FOCUS_IN;
newEvent.data=new Integer(iColumnIndex);
fireEvent(newEvent);
break;
}
}
Program: 71564
Project: 71564
Buggy source:
private void addHeaderButton(int style,ColumnBindingInfo columnHeader,int iWidth,int index){
  Button btnHeader=new Button(cmpHeaders,style);
  btnHeader.setText(columnHeader.getName());
  if (columnHeader.getImageName() != null) {
    btnHeader.setImage(UIHelper.getImage(columnHeader.getImageName()));
  }
  if (columnHeader.getTooltip() != null) {
    btnHeader.setToolTipText(columnHeader.getTooltip());
  }
  FormData fd=new FormData();
  fd.top=new FormAttachment(2);
  int i=btnHeaders.size();
  if (i == 0) {
    fd.left=new FormAttachment(0);
  }
 else {
    Button btnNeighbor=btnHeaders.get(i - 1);
    fd.left=new FormAttachment(btnNeighbor,SPLITTER_WIDTH);
  }
  int defaultWidth=iWidth - SPLITTER_WIDTH;
  int preferWidth=btnHeader.computeSize(SWT.DEFAULT,SWT.DEFAULT).x;
  if (preferWidth > defaultWidth) {
    fd.width=preferWidth;
    columnWidths.remove(index);
    columnWidths.add(index,new Integer(preferWidth + SPLITTER_WIDTH));
  }
 else {
    fd.width=defaultWidth;
  }
  int h=ChartUIUtil.getImageButtonDefaultHeightByPlatform();
  if (h > 0) {
    fd.height=h;
  }
  btnHeader.setLayoutData(fd);
  btnHeader.setVisible(true);
  btnHeader.addListener(SWT.Selection,headerButtonListener);
  btnHeader.addListener(SWT.KeyDown,headerButtonListener);
  btnHeader.addListener(SWT.FocusIn,headerButtonListener);
  btnHeader.addMouseListener(this);
  btnHeader.addMouseMoveListener(this);
  addDragListenerToHeaderButton(btnHeader);
  btnHeaders.add(btnHeader);
  addHeaderSplitter();
}

Fixed version (ground truth):
private void addHeaderButton(int style,ColumnBindingInfo columnHeader,int iWidth,int index){
  Button btnHeader=new Button(cmpHeaders,style);
  btnHeader.setText(columnHeader.getName());
  if (columnHeader.getImageName() != null) {
    btnHeader.setImage(UIHelper.getImage(columnHeader.getImageName()));
  }
  if (columnHeader.getTooltip() != null) {
    btnHeader.setToolTipText(columnHeader.getTooltip());
  }
  FormData fd=new FormData();
  fd.top=new FormAttachment(2);
  int i=btnHeaders.size();
  if (i == 0) {
    fd.left=new FormAttachment(0);
  }
 else {
    Button btnNeighbor=btnHeaders.get(i - 1);
    fd.left=new FormAttachment(btnNeighbor,SPLITTER_WIDTH);
  }
  int defaultWidth=iWidth - SPLITTER_WIDTH;
  int preferWidth=btnHeader.computeSize(SWT.DEFAULT,SWT.DEFAULT).x;
  if (preferWidth > defaultWidth) {
    fd.width=preferWidth;
    columnWidths.remove(index);
    columnWidths.add(index,new Integer(preferWidth + SPLITTER_WIDTH));
  }
 else {
    fd.width=defaultWidth;
  }
  int h=ChartUIUtil.getImageButtonDefaultHeightByPlatform();
  if (h > 0) {
    fd.height=h;
  }
  btnHeader.setLayoutData(fd);
  btnHeader.setVisible(true);
  btnHeader.addListener(SWT.Selection,headerButtonListener);
  btnHeader.addKeyListener(this);
  btnHeader.addTraverseListener(traverseListener);
  btnHeader.addListener(SWT.FocusIn,headerButtonListener);
  btnHeader.addMouseListener(this);
  btnHeader.addMouseMoveListener(this);
  addDragListenerToHeaderButton(btnHeader);
  btnHeaders.add(btnHeader);
  addHeaderSplitter();
}
Program: 71565
Project: 71565
Buggy source:
private void scrollTable(ScrollBar widget,Event event){
  int newSelectionValue=widget.getSelection();
  if (event.keyCode == SWT.ARROW_LEFT) {
    newSelectionValue-=TableCanvas.SCROLL_HORIZONTAL_STEP;
  }
 else   if (event.keyCode == SWT.ARROW_RIGHT) {
    newSelectionValue+=TableCanvas.SCROLL_HORIZONTAL_STEP;
  }
 else   if (event.keyCode == SWT.ARROW_UP) {
    newSelectionValue-=1;
  }
 else   if (event.keyCode == SWT.ARROW_DOWN) {
    newSelectionValue+=1;
  }
  if (newSelectionValue < widget.getMinimum()) {
    newSelectionValue=widget.getMinimum();
  }
 else   if (newSelectionValue > widget.getMaximum()) {
    newSelectionValue=widget.getMaximum();
  }
  widget.setSelection(newSelectionValue);
  Event newEvent=new Event();
  newEvent.widget=widget;
  newEvent.type=SWT.Selection;
  newEvent.data=event.data;
  widget.notifyListeners(SWT.Selection,newEvent);
}

Fixed version (ground truth):
private void scrollTable(ScrollBar widget,KeyEvent event){
  int newSelectionValue=widget.getSelection();
  if (event.keyCode == SWT.ARROW_LEFT) {
    newSelectionValue-=TableCanvas.SCROLL_HORIZONTAL_STEP;
  }
 else   if (event.keyCode == SWT.ARROW_RIGHT) {
    newSelectionValue+=TableCanvas.SCROLL_HORIZONTAL_STEP;
  }
 else   if (event.keyCode == SWT.PAGE_UP || event.keyCode == SWT.ARROW_UP) {
    newSelectionValue-=1;
  }
 else   if (event.keyCode == SWT.PAGE_DOWN || event.keyCode == SWT.ARROW_DOWN) {
    newSelectionValue+=1;
  }
  if (newSelectionValue < widget.getMinimum()) {
    newSelectionValue=widget.getMinimum();
  }
 else   if (newSelectionValue > widget.getMaximum()) {
    newSelectionValue=widget.getMaximum();
  }
  widget.setSelection(newSelectionValue);
  Event newEvent=new Event();
  newEvent.widget=widget;
  newEvent.type=SWT.Selection;
  newEvent.data=event.data;
  widget.notifyListeners(SWT.Selection,newEvent);
}
Program: 71566
Project: 71566
Buggy source:
public IResultObject next() throws DataException {
  if (!this.populator.next())   return null;
  Object[] field=new Object[this.resultClass.getFieldCount()];
  int proceedField=this.originalBindingNames.size();
  for (int i=0; i < this.resultClass.getFieldCount() - proceedField; i++) {
    try {
      field[i]=this.populator.getDocumentIterator().getValue(datasetColumnNameBindingNameMapping.get(this.resultClass.getFieldName(i + 1)));
    }
 catch (    BirtException e) {
      throw DataException.wrap(e);
    }
  }
  for (int i=this.resultClass.getFieldCount() - proceedField; i < field.length; i++) {
    try {
      field[i]=this.populator.getDocumentIterator().getValue(this.originalBindingNames.get(i + proceedField - this.resultClass.getFieldCount()));
    }
 catch (    BirtException e) {
      throw DataException.wrap(e);
    }
  }
  return new ResultObject(this.resultClass,field);
}

Fixed version (ground truth):
public IResultObject next() throws DataException {
  if (!this.populator.next())   return null;
  Object[] field=new Object[this.resultClass.getFieldCount()];
  int proceedField=this.originalBindingNames.size();
  for (int i=0; i < this.resultClass.getFieldCount() - proceedField; i++) {
    try {
      field[i]=this.populator.getDocumentIterator().getValue(datasetColumnNameBindingNameMapping.get(this.resultClass.getFieldName(i + 1)));
    }
 catch (    BirtException e) {
      throw DataException.wrap(e);
    }
  }
  for (int i=this.resultClass.getFieldCount() - proceedField; i < field.length; i++) {
    try {
      String name=this.originalBindingNames.get(i + proceedField - this.resultClass.getFieldCount());
      if (name != null)       field[i]=this.populator.getDocumentIterator().getValue(name);
    }
 catch (    BirtException e) {
      this.originalBindingNames.set(i + proceedField - this.resultClass.getFieldCount(),null);
    }
  }
  return new ResultObject(this.resultClass,field);
}
Program: 71567
Project: 71567
Buggy source:
private String getSystemBirtHome(){
  return AccessController.doPrivileged(new PrivilegedAction<String>(){
    public String run(){
      String home=System.getProperty(IPlatformConfig.BIRT_HOME);
      if (home == null || home.isEmpty()) {
        return "String_Node_Str";
      }
      return home;
    }
  }
);
}

Fixed version (ground truth):
private String getSystemBirtHome(){
  return AccessController.doPrivileged(new PrivilegedAction<String>(){
    public String run(){
      String home=System.getProperty(IPlatformConfig.BIRT_HOME);
      if (home == null || "String_Node_Str".equals(home)) {
        return "String_Node_Str";
      }
      return home;
    }
  }
);
}
Program: 71568
Project: 71568
Buggy source:
public String run(){
  String home=System.getProperty(IPlatformConfig.BIRT_HOME);
  if (home == null || home.isEmpty()) {
    return "String_Node_Str";
  }
  return home;
}

Fixed version (ground truth):
public String run(){
  String home=System.getProperty(IPlatformConfig.BIRT_HOME);
  if (home == null || "String_Node_Str".equals(home)) {
    return "String_Node_Str";
  }
  return home;
}
Program: 71569
Project: 71569
Buggy source:
/** 
 * Save the column meta data to data set handle.
 * @param dataSetHandle
 * @param items
 * @throws SemanticException
 */
public static void updateColumnCache(DataSetHandle dataSetHandle,boolean holdEvent) throws SemanticException {
  DataSessionContext context=null;
  try {
    context=new DataSessionContext(DataEngineContext.DIRECT_PRESENTATION,dataSetHandle.getRoot(),null);
    DataRequestSession drSession=DataRequestSession.newSession(context);
    drSession.refreshMetaData(dataSetHandle,holdEvent);
    drSession.shutdown();
  }
 catch (  BirtException e) {
    logger.entering(DataSetUIUtil.class.getName(),"String_Node_Str",new Object[]{e});
  }
}

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 {
    EngineConfig ec=new EngineConfig();
    ReportEngine engine=(ReportEngine)new ReportEngineFactory().createReportEngine(ec);
    DummyEngineTask engineTask=new DummyEngineTask(engine,new ReportEngineHelper(engine).openReportDesign((ReportDesignHandle)dataSetHandle.getModuleHandle()),dataSetHandle.getModuleHandle());
    DataRequestSession session=engineTask.getDataSession();
    Map appContext=new HashMap();
    appContext.put(DataEngine.MEMORY_DATA_SET_CACHE,new Integer(dataSetHandle.getRowFetchLimit()));
    engineTask.setAppContext(appContext);
    engineTask.run();
    session.refreshMetaData(dataSetHandle,holdEvent);
    engineTask.close();
    engine.destroy();
  }
 catch (  BirtException ex) {
    logger.entering(DataSetUIUtil.class.getName(),"String_Node_Str",new Object[]{ex});
  }
}
Program: 71570
Project: 71570
Buggy source:
/** 
 * Testcase for test createTabItems() method
 */
public void testCreateTabItems(){
  Shell shell=new Shell();
  TabPageGenerator generator=new TabPageGenerator();
  generator.createControl(shell,new ArrayList());
  Control control=generator.getControl();
  if (control instanceof CTabFolder)   assertEquals(0,((CTabFolder)control).getItemCount());
}

Fixed version (ground truth):
/** 
 * Testcase for test createTabItems() method
 */
public void testCreateTabItems(){
  Shell shell=new Shell();
  TabPageGenerator generator=new TabPageGenerator();
  generator.createControl(shell,new ArrayList());
  Control control=generator.getControl();
  if (control instanceof CTabFolder)   assertEquals(0,((CTabFolder)control).getItemCount());
  shell.dispose();
}
Program: 71571
Project: 71571
Buggy source:
/** 
 * @return
 */
public String getFinderClassName(){
  IProject[] projects=getWorkspaceRoot().getProjects();
  if (projects == null || projects.length == 0) {
    return null;
  }
  IType[] types=new IType[0];
  try {
    types=findClasses(projects);
  }
 catch (  InterruptedException e) {
    return null;
  }
catch (  InvocationTargetException e) {
    return null;
  }
 finally {
  }
  Shell shell=getDefaultShell();
  SelectionDialog dialog=new HandlerClassSelectionDialog(shell,types);
  dialog.setTitle(DIALOG_TITLE);
  dialog.setMessage(DIALOG_MESSAGE);
  if (dialog.open() == Window.CANCEL) {
    return null;
  }
  Object[] results=dialog.getResult();
  if ((results == null) || (results.length < 1)) {
    return null;
  }
  IType type=(IType)results[0];
  if (type != null) {
    return type.getFullyQualifiedName('.');
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @return
 */
public String getFinderClassName(){
  IProject[] projects=getWorkspaceRoot().getProjects();
  if (projects == null || projects.length == 0) {
    return null;
  }
  IType[] types=new IType[0];
  try {
    types=findClasses(projects);
  }
 catch (  InterruptedException e) {
    return null;
  }
catch (  InvocationTargetException e) {
    return null;
  }
 finally {
  }
  Shell shell=UIUtil.getDefaultShell();
  SelectionDialog dialog=new HandlerClassSelectionDialog(shell,types);
  dialog.setTitle(DIALOG_TITLE);
  dialog.setMessage(DIALOG_MESSAGE);
  if (dialog.open() == Window.CANCEL) {
    return null;
  }
  Object[] results=dialog.getResult();
  if ((results == null) || (results.length < 1)) {
    return null;
  }
  IType type=(IType)results[0];
  if (type != null) {
    return type.getFullyQualifiedName('.');
  }
  return null;
}
Program: 71573
Project: 71573
Buggy source:
/** 
 * initialize browser.
 * @param display Display
 * @param browser Browser
 * @return
 */
private static void initialize(final Display display,Browser browser){
  browser.addOpenWindowListener(new OpenWindowListener(){
    public void open(    final WindowEvent event){
      final Shell shell=new Shell();
      shell.setLayout(new FillLayout());
      Browser browser=new Browser(shell,SWT.NONE);
      initialize(display,browser);
      event.browser=browser;
      shell.open();
    }
  }
);
  browser.addTitleListener(new TitleListener(){
    public void changed(    TitleEvent event){
      if (event.title != null && event.title.length() > 0) {
        Browser browser=(Browser)event.widget;
        Shell shell=browser.getShell();
        shell.setText(event.title);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * initialize browser.
 * @param display Display
 * @param browser Browser
 * @return
 */
private static void initialize(final Display display,Browser browser){
  browser.addOpenWindowListener(new OpenWindowListener(){
    public void open(    final WindowEvent event){
      final Shell shell=UIUtil.createDefaultShell();
      shell.setLayout(new FillLayout());
      Browser browser=new Browser(shell,SWT.NONE);
      initialize(display,browser);
      event.browser=browser;
      shell.open();
    }
  }
);
  browser.addTitleListener(new TitleListener(){
    public void changed(    TitleEvent event){
      if (event.title != null && event.title.length() > 0) {
        Browser browser=(Browser)event.widget;
        Shell shell=browser.getShell();
        shell.setText(event.title);
      }
    }
  }
);
}
Program: 71574
Project: 71574
Buggy source:
public void open(final WindowEvent event){
  final Shell shell=new Shell();
  shell.setLayout(new FillLayout());
  Browser browser=new Browser(shell,SWT.NONE);
  initialize(display,browser);
  event.browser=browser;
  shell.open();
}

Fixed version (ground truth):
public void open(final WindowEvent event){
  final Shell shell=UIUtil.createDefaultShell();
  shell.setLayout(new FillLayout());
  Browser browser=new Browser(shell,SWT.NONE);
  initialize(display,browser);
  event.browser=browser;
  shell.open();
}
Program: 71575
Project: 71575
Buggy source:
public SampleReportCanvas(Composite parent,int style){
  super(parent,style);
  addPaintListener(new PaintListener(){
    public void paintControl(    PaintEvent pe){
      SampleReportCanvas.this.paintControl(pe);
    }
  }
);
  addControlListener(new ControlListener(){
    public void controlMoved(    ControlEvent e){
    }
    public void controlResized(    ControlEvent e){
      SampleReportCanvas.this.controlResized(e);
    }
  }
);
}

Fixed version (ground truth):
public SampleReportCanvas(Composite parent,int style){
  super(parent,style);
  addPaintListener(new PaintListener(){
    public void paintControl(    PaintEvent pe){
      SampleReportCanvas.this.paintControl(pe);
    }
  }
);
  addControlListener(new ControlListener(){
    public void controlMoved(    ControlEvent e){
    }
    public void controlResized(    ControlEvent e){
      SampleReportCanvas.this.controlResized(e);
    }
  }
);
  addDisposeListener(new DisposeListener(){
    public void widgetDisposed(    DisposeEvent e){
      if (sampleImage != null && !sampleImage.isDisposed()) {
        sampleImage.dispose();
      }
    }
  }
);
}
Program: 71576
Project: 71576
Buggy source:
public void setValue(String name,boolean value){
  try {
    ((StyleHandle)model).setProperty(name,Boolean.valueOf(value));
  }
 catch (  SemanticException e) {
    hasError=true;
    WidgetUtil.processError(new Shell(),e);
  }
}

Fixed version (ground truth):
public void setValue(String name,boolean value){
  try {
    ((StyleHandle)model).setProperty(name,Boolean.valueOf(value));
  }
 catch (  SemanticException e) {
    hasError=true;
    WidgetUtil.processError(e);
  }
}
Program: 71578
Project: 71578
Buggy source:
public Object getAdapter(Object adaptableObject,Class adapterType){
  if (adapterType == IBindingDialogHelper.class && ChartReportItemUtil.isChartHandle(adaptableObject)) {
    if (ChartXTabUtil.getBindingCube((ExtendedItemHandle)adaptableObject) != null) {
      return new ChartCubeBindingDialogHelper();
    }
 else {
      return new BindingDialogHelper();
    }
  }
  return null;
}

Fixed version (ground truth):
public Object getAdapter(Object adaptableObject,Class adapterType){
  if (adapterType == IBindingDialogHelper.class && ChartReportItemUtil.isChartHandle(adaptableObject)) {
    if (ChartXTabUtil.getBindingCube((ExtendedItemHandle)adaptableObject) != null) {
      return new ChartCubeBindingDialogHelper();
    }
 else {
      return new ChartDataSetBindingDialogHelper();
    }
  }
  return null;
}
Program: 71579
Project: 71579
Buggy source:
public boolean hasNextArea(){
  if (textWrapping) {
    return offset < textContent.getText().length();
  }
 else {
    return !hasLineBreak;
  }
}

Fixed version (ground truth):
public boolean hasNextArea(){
  if (!textWrapping && hasLineBreak) {
    return false;
  }
  return offset < textContent.getText().length();
}
Program: 71581
Project: 71581
Buggy source:
/** 
 * @param GEN_add_filter
 * @param GEN_add_group
 * @param qd
 * @throws BirtException
 */
private void _preBasicIV1(QueryDefinition qd) throws BirtException {
  IQueryResults qr=myPreDataEngine.prepare(qd).execute(null);
  IResultIterator ri=qr.getResultIterator();
  ri.moveTo(0);
  String abc="String_Node_Str";
  for (int i=0; i < rowExprName.length; i++)   abc+=rowExprName[i] + "String_Node_Str";
  for (int i=0; i < totalExprName.length; i++)   abc+=totalExprName[i] + "String_Node_Str";
  if (qd.getGroups().size() > 0) {
    abc+="String_Node_Str" + "String_Node_Str";
  }
  this.testPrintln(abc);
  do {
    abc="String_Node_Str";
    for (int i=0; i < rowExprName.length; i++)     abc+=ri.getValue(rowExprName[i]) + "String_Node_Str";
    for (int i=0; i < totalExprName.length; i++)     abc+=ri.getValue(totalExprName[i]) + "String_Node_Str";
    abc+=ri.getRowId();
    if (qd.getGroups().size() > 0) {
      abc+="String_Node_Str" + ri.getStartingGroupLevel() + "String_Node_Str"+ ri.getEndingGroupLevel();
    }
    this.testPrintln(abc);
  }
 while (ri.next());
  ri.close();
  myPreDataEngine.shutdown();
}

Fixed version (ground truth):
/** 
 * @param GEN_add_filter
 * @param GEN_add_group
 * @param qd
 * @throws BirtException
 */
private void _preBasicIV1(QueryDefinition qd) throws BirtException {
  HashMap appContext=new HashMap();
  appContext.put(DataEngine.MEMORY_BUFFER_SIZE,10);
  IQueryResults qr=myPreDataEngine.prepare(qd,appContext).execute(null);
  IResultIterator ri=qr.getResultIterator();
  ri.moveTo(0);
  String abc="String_Node_Str";
  for (int i=0; i < rowExprName.length; i++)   abc+=rowExprName[i] + "String_Node_Str";
  for (int i=0; i < totalExprName.length; i++)   abc+=totalExprName[i] + "String_Node_Str";
  if (qd.getGroups().size() > 0) {
    abc+="String_Node_Str" + "String_Node_Str";
  }
  this.testPrintln(abc);
  do {
    abc="String_Node_Str";
    for (int i=0; i < rowExprName.length; i++)     abc+=ri.getValue(rowExprName[i]) + "String_Node_Str";
    for (int i=0; i < totalExprName.length; i++)     abc+=ri.getValue(totalExprName[i]) + "String_Node_Str";
    abc+=ri.getRowId();
    if (qd.getGroups().size() > 0) {
      abc+="String_Node_Str" + ri.getStartingGroupLevel() + "String_Node_Str"+ ri.getEndingGroupLevel();
    }
    this.testPrintln(abc);
  }
 while (ri.next());
  ri.close();
  myPreDataEngine.shutdown();
}
Program: 71582
Project: 71582
Buggy source:
public IResultObject next() throws DataException {
}

Fixed version (ground truth):
public IResultObject next() throws DataException {
  if (!this.populator.next())   return null;
  Object[] field=new Object[this.resultClass.getFieldCount()];
  int proceedField=this.originalBindingNames.size();
  for (int i=0; i < this.resultClass.getFieldCount() - proceedField; i++) {
    try {
      field[i]=this.populator.getDocumentIterator().getValue(datasetColumnNameBindingNameMapping.get(this.resultClass.getFieldName(i + 1)));
    }
 catch (    BirtException e) {
      throw DataException.wrap(e);
    }
  }
  for (int i=this.resultClass.getFieldCount() - proceedField; i < field.length; i++) {
    try {
      field[i]=this.populator.getDocumentIterator().getValue(this.originalBindingNames.get(i + proceedField - this.resultClass.getFieldCount()));
    }
 catch (    BirtException e) {
      throw DataException.wrap(e);
    }
  }
  return new ResultObject(this.resultClass,field);
}
Program: 71583
Project: 71583
Buggy source:
/** 
 * @param query
 * @param targetGroups
 * @param original
 * @return
 * @throws BirtException
 */
private IResultClass populateResultClass(IQueryDefinition query,List<IGroupInstanceInfo> targetGroups,IResultClass original) throws BirtException {
  List<ResultFieldMetadata> list=new ArrayList<ResultFieldMetadata>();
  for (int i=1; i <= original.getFieldCount(); i++) {
    list.add(original.getFieldMetaData(i));
  }
  this.originalBindingNames=new ArrayList<String>();
  Iterator<IBinding> bindings=query.getBindings().values().iterator();
  while (bindings.hasNext()) {
    IBinding binding=bindings.next();
    if (PLSUtil.isPLSProcessedBinding(binding)) {
      ResultFieldMetadata rfmeta=new ResultFieldMetadata(-1,PLSUtil.constructNonReCalBindingDataSetName(binding.getBindingName()),null,DataType.getClass(binding.getDataType()),null,false);
      list.add(rfmeta);
      this.originalBindingNames.add(binding.getBindingName());
    }
  }
  return new ResultClass(list);
}

Fixed version (ground truth):
/** 
 * @param query
 * @param targetGroups
 * @param original
 * @return
 * @throws BirtException
 */
private IResultClass populateResultClass(IQueryDefinition query,List<IGroupInstanceInfo> targetGroups,IResultClass original) throws BirtException {
  List<ResultFieldMetadata> list=new ArrayList<ResultFieldMetadata>();
  for (int i=1; i <= original.getFieldCount(); i++) {
    list.add(original.getFieldMetaData(i));
  }
  this.originalBindingNames=new ArrayList<String>();
  this.datasetColumnNameBindingNameMapping=new HashMap<String,String>();
  Iterator<IBinding> bindings=query.getBindings().values().iterator();
  while (bindings.hasNext()) {
    IBinding binding=bindings.next();
    if (PLSUtil.isPLSProcessedBinding(binding)) {
      ResultFieldMetadata rfmeta=new ResultFieldMetadata(-1,PLSUtil.constructNonReCalBindingDataSetName(binding.getBindingName()),null,DataType.getClass(binding.getDataType()),null,false);
      list.add(rfmeta);
      this.originalBindingNames.add(binding.getBindingName());
    }
 else     if (binding.getExpression() instanceof IScriptExpression && (IScriptExpression)binding.getExpression() != null && binding.getAggrFunction() == null) {
      String name=ExpressionUtil.getColumnName(((IScriptExpression)binding.getExpression()).getText());
      if (name != null)       this.datasetColumnNameBindingNameMapping.put(name,binding.getBindingName());
    }
  }
  return new ResultClass(list);
}
Program: 71584
Project: 71584
Buggy source:
private void populateSeriesTypesList(){
  if (cbSeriesType == null) {
    return;
  }
  cbSeriesType.removeAll();
  Series series=getSeriesDefinitionForProcessing().getDesignTimeSeries();
  if (getCurrentChartType().canCombine()) {
    populateSeriesTypes(ChartUIExtensionsImpl.instance().getUIChartTypeExtensions(getContext().getClass().getSimpleName()),series,this.orientation);
  }
 else {
    String seriesName=series.getDisplayName();
    cbSeriesType.add(seriesName);
    cbSeriesType.select(0);
  }
  if (this.chartModel instanceof ChartWithAxes) {
    Axis xAxis=((Axis)((ChartWithAxes)chartModel).getAxes().get(0));
    if (xAxis.getAssociatedAxes().size() > 1) {
      String lastType=ChartCacheManager.getInstance().findSeriesType();
      if (lastType != null) {
        cbSeriesType.setText(lastType);
      }
 else {
        Axis overlayAxis=(Axis)xAxis.getAssociatedAxes().get(1);
        if (!overlayAxis.getSeriesDefinitions().isEmpty()) {
          String sDisplayName=((SeriesDefinition)overlayAxis.getSeriesDefinitions().get(0)).getDesignTimeSeries().getDisplayName();
          cbSeriesType.setText(sDisplayName);
        }
      }
      changeOverlaySeriesType();
    }
  }
}

Fixed version (ground truth):
private void populateSeriesTypesList(){
  if (cbSeriesType == null) {
    return;
  }
  cbSeriesType.removeAll();
  Series series=getSeriesDefinitionForProcessing().getDesignTimeSeries();
  if (getCurrentChartType().canCombine()) {
    populateSeriesTypes(ChartUIExtensionsImpl.instance().getUIChartTypeExtensions(getContext().getClass().getSimpleName()),series,this.orientation);
  }
 else {
    String seriesName=series.getDisplayName();
    cbSeriesType.add(seriesName);
    cbSeriesType.select(0);
  }
  if (this.chartModel instanceof ChartWithAxes) {
    Axis xAxis=((Axis)((ChartWithAxes)chartModel).getAxes().get(0));
    if (xAxis.getAssociatedAxes().size() > 1) {
      String lastType=ChartCacheManager.getInstance().findSeriesType();
      Axis overlayAxis=(Axis)xAxis.getAssociatedAxes().get(1);
      if (!overlayAxis.getSeriesDefinitions().isEmpty()) {
        Series oseries=((SeriesDefinition)overlayAxis.getSeriesDefinitions().get(0)).getDesignTimeSeries();
        String sDisplayName=oseries.getDisplayName();
        if (lastType != null) {
          cbSeriesType.setText(lastType);
        }
 else {
          cbSeriesType.setText(sDisplayName);
        }
        String seriesName=oseries.getSeriesIdentifier().toString();
        if (seriesName.trim().length() != 0) {
          Iterator<Entry<String,Series>> itr=htSeriesNames.entrySet().iterator();
          while (itr.hasNext()) {
            Entry<String,Series> entry=itr.next();
            entry.getValue().setSeriesIdentifier(seriesName);
          }
        }
      }
      changeOverlaySeriesType();
    }
  }
}
Program: 71585
Project: 71585
Buggy source:
public void addPages(){
  newReportFileWizardPage=new WizardNewReportCreationPage(WIZARDPAGE,selection,fileExtension);
  addPage(newReportFileWizardPage);
  templateChoicePage=new WizardTemplateChoicePage(TEMPLATECHOICEPAGE);
  addPage(templateChoicePage);
  newReportFileWizardPage.setTitle(REPORT);
  newReportFileWizardPage.setDescription(CREATE_A_NEW_REPORT);
  templateChoicePage.setTitle(REPORT);
  templateChoicePage.setDescription(SELECT_A_REPORT_TEMPLATE);
  resetUniqueCount();
  newReportFileWizardPage.setFileName(getUniqueReportName(NEW_REPORT_FILE_NAME_PREFIX,NEW_REPORT_FILE_EXTENSION));
  newReportFileWizardPage.setContainerFullPath(getDefaultContainerPath());
  newReportFileWizardPage.setTemplateChoicePage(templateChoicePage);
  templateChoicePage.setLTRDirection(ReportPlugin.getDefault().getLTRReportDirection(ResourcesPlugin.getWorkspace().getRoot().getProject(getDefaultContainerPath().lastSegment())));
}

Fixed version (ground truth):
public void addPages(){
  newReportFileWizardPage=new WizardNewReportCreationPage(WIZARDPAGE,selection,fileExtension);
  addPage(newReportFileWizardPage);
  templateChoicePage=new WizardTemplateChoicePage(TEMPLATECHOICEPAGE);
  addPage(templateChoicePage);
  newReportFileWizardPage.setTitle(REPORT);
  newReportFileWizardPage.setDescription(CREATE_A_NEW_REPORT);
  templateChoicePage.setTitle(REPORT);
  templateChoicePage.setDescription(SELECT_A_REPORT_TEMPLATE);
  resetUniqueCount();
  newReportFileWizardPage.setFileName(getUniqueReportName(NEW_REPORT_FILE_NAME_PREFIX,NEW_REPORT_FILE_EXTENSION));
  newReportFileWizardPage.setContainerFullPath(getDefaultContainerPath());
  newReportFileWizardPage.setTemplateChoicePage(templateChoicePage);
}
Program: 71586
Project: 71586
Buggy source:
public static String formatDateTime(String format,Locale locale){
  return locale2Code.get(locale) + format;
}

Fixed version (ground truth):
public static String formatDateTime(String format,Locale locale){
  String language=locale.getLanguage();
  String code=locale2Code.get(locale);
  if (code == null) {
    code=locale2Code.get(new Locale(language));
  }
  return code + format;
}