nus-yam/ex-repair huggingface dataset:
Program: 65764
Project: 65764
Buggy source:
/** 
 * Add incremental rows to output stream
 * @param outputStream
 * @param rowLensStream
 * @param rowCount
 * @param stringTable
 * @param map
 * @param cacheRequestMap
 * @throws DataException
 */
public void incrementalUpdate(OutputStream outputStream,OutputStream rowLensStream,int rowCount,Map<String,StringTable> stringTable,Map<String,IIndexSerializer> map,List<IBinding> cacheRequestMap) throws DataException ;

Fixed version (ground truth):
/** 
 * Add incremental rows to output stream
 * @param outputStream
 * @param rowLensStream
 * @param rowCount
 * @param stringTable
 * @param map
 * @param cacheRequestMap
 * @throws DataException
 */
public void incrementalUpdate(OutputStream outputStream,OutputStream rowLensStream,int rowCount,Map<String,StringTable> stringTable,Map<String,IIndexSerializer> map,List<IBinding> cacheRequestMap,int version) throws DataException ;
Program: 65766
Project: 65766
Buggy source:
public Control createPageControl(Composite parent){
  Composite content=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout();
  content.setLayout(layout);
  content.setLayoutData(new GridData(GridData.FILL_BOTH));
  Label txt=new Label(content,SWT.LEFT);
  txt.setText(Messages.formatMessage("String_Node_Str",new Object[]{dataSourceDesign.getName()}));
  Label nextLineLabel=new Label(content,SWT.LEFT);
  nextLineLabel.setText(Messages.formatMessage("String_Node_Str",new Object[]{dataSourceDesign.getName()}));
  Label thirdLineLabel=new Label(content,SWT.LEFT);
  thirdLineLabel.setText(Messages.getMessage("String_Node_Str"));
  return content;
}

Fixed version (ground truth):
public Control createPageControl(Composite parent){
  Composite content=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout();
  content.setLayout(layout);
  content.setLayoutData(new GridData(GridData.FILL_BOTH));
  Text txt=new Text(content,SWT.LEFT | SWT.MULTI | SWT.H_SCROLL| SWT.V_SCROLL);
  txt.setEditable(false);
  txt.setText(Messages.formatMessage("String_Node_Str",new Object[]{dataSourceDesign.getName()}));
  txt.append(Messages.formatMessage("String_Node_Str",new Object[]{dataSourceDesign.getName()}));
  txt.append(Messages.getMessage("String_Node_Str"));
  txt.setLayoutData(new GridData(GridData.FILL_BOTH));
  return content;
}
Program: 65767
Project: 65767
Buggy source:
private void loadDriverExtensions(){
  if (driverExtensions != null)   return;
synchronized (this) {
    driverExtensions=new HashMap();
    IExtensionRegistry extReg=Platform.getExtensionRegistry();
    IExtensionPoint extPoint=extReg.getExtensionPoint(OdaJdbcDriver.Constants.DRIVER_INFO_EXTENSION);
    if (extPoint == null)     return;
    IExtension[] exts=extPoint.getExtensions();
    if (exts == null)     return;
    for (int e=0; e < exts.length; e++) {
      IConfigurationElement[] configElems=exts[e].getConfigurationElements();
      if (configElems == null)       continue;
      for (int i=0; i < configElems.length; i++) {
        if (configElems[i].getName().equals(OdaJdbcDriver.Constants.DRIVER_INFO_ELEM_JDBCDRIVER)) {
          String driverClass=configElems[i].getAttribute(OdaJdbcDriver.Constants.DRIVER_INFO_ATTR_DRIVERCLASS);
          String connectionFactory=configElems[i].getAttribute(OdaJdbcDriver.Constants.DRIVER_INFO_ATTR_CONNFACTORY);
          logger.info("String_Node_Str" + driverClass + "String_Node_Str"+ connectionFactory);
          if (driverClass != null && driverClass.length() > 0 && connectionFactory != null && connectionFactory.length() > 0) {
            driverExtensions.put(driverClass,configElems[i]);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void loadDriverExtensions(){
  if (loadedDriver)   return;
synchronized (this) {
    if (loadedDriver)     return;
    driverExtensions=new HashMap();
    IExtensionRegistry extReg=Platform.getExtensionRegistry();
    IExtensionPoint extPoint=extReg.getExtensionPoint(OdaJdbcDriver.Constants.DRIVER_INFO_EXTENSION);
    if (extPoint == null)     return;
    IExtension[] exts=extPoint.getExtensions();
    if (exts == null)     return;
    for (int e=0; e < exts.length; e++) {
      IConfigurationElement[] configElems=exts[e].getConfigurationElements();
      if (configElems == null)       continue;
      for (int i=0; i < configElems.length; i++) {
        if (configElems[i].getName().equals(OdaJdbcDriver.Constants.DRIVER_INFO_ELEM_JDBCDRIVER)) {
          String driverClass=configElems[i].getAttribute(OdaJdbcDriver.Constants.DRIVER_INFO_ATTR_DRIVERCLASS);
          String connectionFactory=configElems[i].getAttribute(OdaJdbcDriver.Constants.DRIVER_INFO_ATTR_CONNFACTORY);
          logger.info("String_Node_Str" + driverClass + "String_Node_Str"+ connectionFactory);
          if (driverClass != null && driverClass.length() > 0 && connectionFactory != null && connectionFactory.length() > 0) {
            driverExtensions.put(driverClass,configElems[i]);
          }
        }
      }
    }
    loadedDriver=true;
  }
}
Program: 65768
Project: 65768
Buggy source:
public void startForeign(IForeignContent foreign) throws BirtException {
  if (IForeignContent.HTML_TYPE.equalsIgnoreCase(foreign.getRawType())) {
    if (HTML2Content.allInline(foreign)) {
      HyperlinkDef link=parseHyperLink(foreign);
      IAutoTextContent autoText=foreign.getReportContent().createAutoTextContent();
      autoText.setText(HTML2Content.getForeignPlainText(foreign));
      startAutoText(autoText);
    }
 else {
      HTML2Content.html2Content(foreign);
      HyperlinkDef link=parseHyperLink(foreign);
      engine.processForeign(foreign,link);
    }
  }
}

Fixed version (ground truth):
public void startForeign(IForeignContent foreign) throws BirtException {
  if (IForeignContent.HTML_TYPE.equalsIgnoreCase(foreign.getRawType())) {
    HTML2Content.html2Content(foreign);
    HyperlinkDef link=parseHyperLink(foreign);
    engine.processForeign(foreign,link);
  }
}
Program: 65769
Project: 65769
Buggy source:
private int evaluatePeriodsN(String n) throws DataException, BirtException {
  int num=0;
  if (n == null || n.trim().equals("String_Node_Str")) {
    n="String_Node_Str";
  }
  try {
    num=Integer.valueOf(n);
  }
 catch (  Exception e) {
    num=(Integer)ScriptEvalUtil.evalExpr(new ScriptExpression(n),this.context.getDataEngineContext().getScriptContext(),"String_Node_Str",0);
  }
  return num;
}

Fixed version (ground truth):
private int evaluatePeriodsN(String n,Object expression) throws DataException, BirtException {
  int num=0;
  if (n == null || n.trim().equals("String_Node_Str")) {
    n="String_Node_Str";
  }
  try {
    num=Integer.valueOf(n);
  }
 catch (  Exception e) {
    ScriptExpression scriptExpression=null;
    if (expression instanceof Expression) {
      scriptExpression=this.adaptExpression((Expression)expression);
      ;
    }
 else {
      scriptExpression=adaptExpression(n,DesignChoiceConstants.PARAM_TYPE_ANY);
    }
    num=(Integer)ScriptEvalUtil.evalExpr(scriptExpression,this.context.getDataEngineContext().getScriptContext(),"String_Node_Str",0);
  }
  return num;
}
Program: 65770
Project: 65770
Buggy source:
private int evaluatePeriodsNForTrailingFunction(String n) throws DataException, BirtException {
  int num=0;
  if (n == null || n.trim().equals("String_Node_Str")) {
    n="String_Node_Str";
  }
  try {
    num=Integer.valueOf(n);
  }
 catch (  Exception e) {
    num=(Integer)ScriptEvalUtil.evalExpr(new ScriptExpression(n),this.context.getDataEngineContext().getScriptContext(),"String_Node_Str",0);
  }
  return num;
}

Fixed version (ground truth):
private int evaluatePeriodsNForTrailingFunction(String n,Object expression) throws DataException, BirtException {
  if (n == null || n.trim().equals("String_Node_Str")) {
    return 1;
  }
  return evaluatePeriodsN(n,expression);
}
Program: 65773
Project: 65773
Buggy source:
public RGB[] getCustomColorsPreference(){
  String rgbs=PreferenceFactory.getInstance().getPreferences(this,UIUtil.getCurrentProject()).getString(CUSTOM_COLORS_PREFERENCE);
  List<RGB> rgbList=new ArrayList<RGB>();
  if (rgbs != null) {
    String[] splits=rgbs.split("String_Node_Str");
    for (int i=0; i < splits.length; i++) {
      try {
        RGB rgb=DEUtil.getRGBValue(Integer.parseInt(splits[i]));
        rgbList.add(rgb);
      }
 catch (      Exception e) {
      }
    }
  }
  return rgbList.toArray(new RGB[0]);
}

Fixed version (ground truth):
public RGB[] getCustomColorsPreference(){
  String rgbs=PreferenceFactory.getInstance().getPreferences(this,UIUtil.getCurrentProject()).getString(CUSTOM_COLORS_PREFERENCE);
  List<RGB> rgbList=new ArrayList<RGB>();
  if (rgbs != null && rgbs.trim().length() > 0) {
    String[] splits=rgbs.split("String_Node_Str");
    for (int i=0; i < splits.length; i++) {
      try {
        RGB rgb=DEUtil.getRGBValue(Integer.parseInt(splits[i]));
        rgbList.add(rgb);
      }
 catch (      Exception e) {
      }
    }
  }
  return rgbList.toArray(new RGB[0]);
}
Program: 65774
Project: 65774
Buggy source:
public void setCustomColorsPreference(RGB[] rgbs){
  StringBuffer buffer=new StringBuffer();
  if (rgbs != null) {
    for (int i=0; i < rgbs.length; i++) {
      buffer.append(DEUtil.getRGBInt(rgbs[i]));
      if (i < rgbs.length - 1)       buffer.append("String_Node_Str");
    }
  }
  PreferenceFactory.getInstance().getPreferences(this,UIUtil.getCurrentProject()).setValue(CUSTOM_COLORS_PREFERENCE,buffer.toString().length() > 0 ? buffer.toString() : null);
  try {
    PreferenceFactory.getInstance().getPreferences(this,UIUtil.getCurrentProject()).save();
  }
 catch (  IOException e) {
    ExceptionHandler.handle(e);
  }
}

Fixed version (ground truth):
public void setCustomColorsPreference(RGB[] rgbs){
  StringBuffer buffer=new StringBuffer();
  if (rgbs != null) {
    for (int i=0; i < rgbs.length; i++) {
      buffer.append(DEUtil.getRGBInt(rgbs[i]));
      if (i < rgbs.length - 1)       buffer.append("String_Node_Str");
    }
  }
  String newColorStatus=buffer.toString();
  String oldColorStatus=PreferenceFactory.getInstance().getPreferences(this,UIUtil.getCurrentProject()).getString(CUSTOM_COLORS_PREFERENCE);
  if (!newColorStatus.equalsIgnoreCase(oldColorStatus)) {
    PreferenceFactory.getInstance().getPreferences(this,UIUtil.getCurrentProject()).setValue(CUSTOM_COLORS_PREFERENCE,newColorStatus);
    try {
      PreferenceFactory.getInstance().getPreferences(this,UIUtil.getCurrentProject()).save();
    }
 catch (    IOException e) {
      ExceptionHandler.handle(e);
    }
  }
}
Program: 65775
Project: 65775
Buggy source:
/** 
 * @throws BirtException 
 * @throws IOException 
 */
private void saveCurrentRow() throws IOException, BirtException {
  if (columnList == null) {
    columnList=new ArrayList();
    Iterator keyIterator=boundColumnValueMap.keySet().iterator();
    while (keyIterator.hasNext()) {
      Object key=keyIterator.next();
      columnList.add(key);
    }
    IOUtil.writeInt(rowOutputStream,columnList.size());
    for (int i=0; i < columnList.size(); i++) {
      IOUtil.writeObject(rowOutputStream,columnList.get(i));
    }
  }
  IOUtil.writeInt(rowOutputStream,getRowIndex());
  IOUtil.writeInt(rowOutputStream,getStartingGroupLevel());
  IOUtil.writeInt(rowOutputStream,getEndingGroupLevel());
  for (int i=0; i < columnList.size(); i++) {
    IOUtil.writeObject(rowOutputStream,getValue((String)columnList.get(i)));
  }
}

Fixed version (ground truth):
/** 
 * @throws BirtException 
 * @throws IOException 
 */
private void saveCurrentRow() throws IOException, BirtException {
  if (columnList == null) {
    columnList=new ArrayList();
    Iterator keyIterator=boundColumnValueMap.keySet().iterator();
    while (keyIterator.hasNext()) {
      Object key=keyIterator.next();
      columnList.add(key);
    }
    IOUtil.writeInt(rowOutputStream,columnList.size());
    for (int i=0; i < columnList.size(); i++) {
      IOUtil.writeObject(rowOutputStream,columnList.get(i));
    }
    rowOutputStream.flush();
  }
  IOUtil.writeInt(rowOutputStream,getRowIndex());
  IOUtil.writeInt(rowOutputStream,getStartingGroupLevel());
  IOUtil.writeInt(rowOutputStream,getEndingGroupLevel());
  for (int i=0; i < columnList.size(); i++) {
    IOUtil.writeObject(rowOutputStream,getValue((String)columnList.get(i)));
  }
}
Program: 65776
Project: 65776
Buggy source:
/** 
 * Since Eclipse TextFlow figure ignore the trailing /r/n for calculating the client size, we must append the extra size ourselves.
 * @return dimension for the client area used by the editor.
 */
public Rectangle getEditorArea(){
  Rectangle rect=getClientArea().getCopy();
  String s=getText();
  int count=0;
  if (s != null && s.length() > 1) {
    for (int i=s.length() - 2; i >= 0; i-=2) {
      if ("String_Node_Str".equals(s.substring(i,i + 2))) {
        count++;
      }
 else {
        break;
      }
    }
  }
  int hh=getMinimumFontSize(getFont());
  rect.height+=count * hh + ((count == 0) ? 0 : (hh / 2));
  return rect;
}

Fixed version (ground truth):
/** 
 * Since Eclipse TextFlow figure ignore the trailing /r/n for calculating the client size, we must append the extra size ourselves.
 * @return dimension for the client area used by the editor.
 */
public Rectangle getEditorArea(){
  Rectangle rect=getClientArea().getCopy();
  String s=getText();
  int count=0;
  if (s != null && s.length() > 1) {
    for (int i=s.length() - 2; i >= 0; i-=2) {
      if ("String_Node_Str".equals(s.substring(i,i + 2))) {
      }
 else {
        break;
      }
    }
  }
  int hh=getMinimumFontSize(getFont());
  rect.height+=count * hh + ((count == 0) ? 0 : (hh / 2));
  return rect;
}
Program: 65778
Project: 65778
Buggy source:
/** 
 * @param stopSign
 * @throws DataException
 */
private void doRowFiltering() throws DataException {
  if (!psController.needDoOperation(PassStatusController.RESULT_SET_FILTERING))   return;
  boolean changeMaxRows=filterByRow.getFilterList(FilterByRow.GROUP_FILTER).size() + filterByRow.getFilterList(FilterByRow.AGGR_FILTER).size() > 0;
  applyFilters(FilterByRow.QUERY_FILTER,changeMaxRows);
  filterByRow.setWorkingFilterSet(FilterByRow.NO_FILTER);
}

Fixed version (ground truth):
/** 
 * @param stopSign
 * @throws DataException
 */
private void doRowFiltering() throws DataException {
  if (!psController.needDoOperation(PassStatusController.RESULT_SET_FILTERING))   return;
  if (needRowSortOnAggregation() && this.computedColumnHelper != null)   this.computedColumnHelper.suppressException(true);
  boolean changeMaxRows=filterByRow.getFilterList(FilterByRow.GROUP_FILTER).size() + filterByRow.getFilterList(FilterByRow.AGGR_FILTER).size() > 0;
  applyFilters(FilterByRow.QUERY_FILTER,changeMaxRows);
  filterByRow.setWorkingFilterSet(FilterByRow.NO_FILTER);
  if (this.computedColumnHelper != null)   this.computedColumnHelper.suppressException(false);
}
Program: 65780
Project: 65780
Buggy source:
public void startForeign(IForeignContent foreign) throws BirtException {
  if (IForeignContent.HTML_TYPE.equalsIgnoreCase(foreign.getRawType())) {
    HTML2Content.html2Content(foreign);
    HyperlinkDef link=parseHyperLink(foreign);
    engine.processForeign(foreign,link);
  }
}

Fixed version (ground truth):
public void startForeign(IForeignContent foreign) throws BirtException {
  if (IForeignContent.HTML_TYPE.equalsIgnoreCase(foreign.getRawType())) {
    if (HTML2Content.allInline(foreign)) {
      HyperlinkDef link=parseHyperLink(foreign);
      IAutoTextContent autoText=foreign.getReportContent().createAutoTextContent();
      autoText.setText(HTML2Content.getForeignPlainText(foreign));
      startAutoText(autoText);
    }
 else {
      HTML2Content.html2Content(foreign);
      HyperlinkDef link=parseHyperLink(foreign);
      engine.processForeign(foreign,link);
    }
  }
}
Program: 65781
Project: 65781
Buggy source:
private void updateAxisTitleLocationNLabelSize(final OneAxis axPV,final int iYTitleLocation,double dYAxisTitleThickness,double dWTotal,double dX,double dX1,double dX2){
  if (axPV.isShowLabels() && axPV.getScale().isCategoryScale()) {
    AutoScale.AxisLabelInfo ali=axPV.getScale().getAxisLabelInfo();
    if (axPV.getLabelPosition() == IConstants.LEFT) {
      double labelThickness=dX - dX1 - getTickSize()- ((iYTitleLocation == LEFT) ? dYAxisTitleThickness : 0);
      labelThickness=ali.getValidSize(labelThickness);
      ali.dMaxSize=labelThickness;
      axPV.setTitleCoordinate((iYTitleLocation == LEFT) ? dX - 1 - getTickSize()- labelThickness- dYAxisTitleThickness : dX2 + 1 - dYAxisTitleThickness);
    }
 else     if (axPV.getLabelPosition() == IConstants.RIGHT) {
      double labelThickness=dX2 - dX - getTickSize()- ((iYTitleLocation == RIGHT) ? dYAxisTitleThickness : 0);
      labelThickness=ali.getValidSize(labelThickness);
      ali.dMaxSize=labelThickness;
      axPV.setTitleCoordinate((iYTitleLocation == LEFT) ? dX1 - 1 : dX + 1 + labelThickness);
    }
  }
 else {
    axPV.setTitleCoordinate((iYTitleLocation == LEFT) ? dX1 - 1 : dX2 + 1 - dYAxisTitleThickness);
  }
}

Fixed version (ground truth):
private void updateAxisTitleLocationNLabelSize(final OneAxis axPV,final int iYTitleLocation,double dYAxisTitleThickness,double dWTotal,double dX,double dX1,double dX2){
  if (axPV.isShowLabels() && axPV.getScale().isCategoryScale()) {
    AutoScale.AxisLabelInfo ali=axPV.getScale().getAxisLabelInfo();
    if (axPV.getLabelPosition() == IConstants.LEFT) {
      double tickSize=((axPV.getCombinedTickStyle() & TICK_LEFT) == TICK_LEFT) ? getTickSize() : 0;
      double labelThickness=dX - dX1 - tickSize- ((iYTitleLocation == LEFT) ? dYAxisTitleThickness : 0);
      labelThickness=ali.getValidSize(labelThickness);
      ali.dMaxSize=labelThickness;
      axPV.setTitleCoordinate((iYTitleLocation == LEFT) ? dX - 1 - tickSize- labelThickness- dYAxisTitleThickness : dX2 + 1 - dYAxisTitleThickness);
    }
 else     if (axPV.getLabelPosition() == IConstants.RIGHT) {
      double tickSize=((axPV.getCombinedTickStyle() & TICK_RIGHT) == TICK_RIGHT) ? getTickSize() : 0;
      double labelThickness=dX2 - dX - tickSize- ((iYTitleLocation == RIGHT) ? dYAxisTitleThickness : 0);
      labelThickness=ali.getValidSize(labelThickness);
      ali.dMaxSize=labelThickness;
      axPV.setTitleCoordinate((iYTitleLocation == LEFT) ? dX1 - 1 : dX + 1 + tickSize+ labelThickness);
    }
  }
 else {
    axPV.setTitleCoordinate((iYTitleLocation == LEFT) ? dX1 - 1 : dX2 + 1 - dYAxisTitleThickness);
  }
}
Program: 65783
Project: 65783
Buggy source:
private boolean validateFileName(){
  if ("String_Node_Str".equals(getFileName())) {
    setErrorMessage(null);
    setMessage(Messages.getString("String_Node_Str"));
    return false;
  }
  if (!new File(getFileName()).exists()) {
    setErrorMessage(Messages.getString("String_Node_Str"));
    return false;
  }
  setErrorMessage(null);
  setMessage(null);
  return true;
}

Fixed version (ground truth):
private boolean validateFileName(){
  if ("String_Node_Str".equals(getFileName())) {
    setErrorMessage(null);
    setMessage(Messages.getString("String_Node_Str"));
    return false;
  }
  File file=new File(getFileName());
  if (!file.exists() || !file.isFile()) {
    setErrorMessage(Messages.getString("String_Node_Str"));
    return false;
  }
  setErrorMessage(null);
  setMessage(null);
  return true;
}
Program: 65784
Project: 65784
Buggy source:
public static DataItemHandle createColumnBindingAndDataItem(ReportItemHandle owner,LevelAttributeHandle levelAttrHandle) throws SemanticException {
  ComputedColumn bindingColumn=StructureFactory.newComputedColumn(owner,levelAttrHandle.getName());
  ComputedColumnHandle bindingHandle=owner.addColumnBinding(bindingColumn,false);
  LevelHandle levelHandle=(LevelHandle)levelAttrHandle.getElementHandle();
  String dimensionName=levelHandle.getContainer().getContainer().getName();
  bindingHandle.setExpression(ExpressionUtil.createJSDimensionExpression(dimensionName,levelHandle.getName(),levelAttrHandle.getName()));
  DataItemHandle dataHandle=DesignElementFactory.getInstance().newDataItem(levelAttrHandle.getName());
  CrosstabAdaptUtil.formatDataItem(levelHandle,dataHandle);
  dataHandle.setResultSetColumn(bindingHandle.getName());
  if (LevelAttribute.DATE_TIME_ATTRIBUTE_NAME.equals(levelAttrHandle.getName())) {
    bindingHandle.setDataType(DesignChoiceConstants.COLUMN_DATA_TYPE_DATETIME);
    dataHandle.getPrivateStyle().setDateTimeFormatCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_CUSTOM);
    dataHandle.getPrivateStyle().setDateTimeFormat(levelHandle.getDateTimeFormat());
  }
 else {
    bindingHandle.setDataType(levelAttrHandle.getDataType());
  }
  return dataHandle;
}

Fixed version (ground truth):
public static DataItemHandle createColumnBindingAndDataItem(ReportItemHandle owner,LevelAttributeHandle levelAttrHandle) throws SemanticException {
  ComputedColumn bindingColumn=StructureFactory.newComputedColumn(owner,levelAttrHandle.getName());
  ComputedColumnHandle bindingHandle=owner.addColumnBinding(bindingColumn,false);
  LevelHandle levelHandle=(LevelHandle)levelAttrHandle.getElementHandle();
  String dimensionName=levelHandle.getContainer().getContainer().getName();
  bindingHandle.setExpression(ExpressionUtil.createJSDimensionExpression(dimensionName,levelHandle.getName(),levelAttrHandle.getName()));
  DataItemHandle dataHandle=DesignElementFactory.getInstance().newDataItem(levelAttrHandle.getName());
  String type=levelHandle.getDataType();
  String aliment=levelHandle.getAlignment();
  formatDataItem(type,null,aliment,dataHandle);
  dataHandle.setResultSetColumn(bindingHandle.getName());
  if (LevelAttribute.DATE_TIME_ATTRIBUTE_NAME.equals(levelAttrHandle.getName())) {
    bindingHandle.setDataType(DesignChoiceConstants.COLUMN_DATA_TYPE_DATETIME);
    dataHandle.getPrivateStyle().setDateTimeFormatCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_CUSTOM);
    dataHandle.getPrivateStyle().setDateTimeFormat(levelHandle.getDateTimeFormat());
  }
 else {
    bindingHandle.setDataType(levelAttrHandle.getDataType());
  }
  return dataHandle;
}
Program: 65785
Project: 65785
Buggy source:
public RowState(Element element,Map<Element,StyleProperties> cssStyles,IContent parent,ActionContent action){
  super(element,cssStyles,action);
  content=(RowContent)parent.getReportContent().createRowContent();
  setParent(parent);
  content.setHeight(PropertyUtil.getDimensionAttribute(element,"String_Node_Str"));
  HTML2Content.handleStyle(element,cssStyles,content);
}

Fixed version (ground truth):
public RowState(Element element,Map<Element,StyleProperties> cssStyles,IContent parent,ActionContent action,Hashtable<Integer,Integer> records,int index){
  super(element,cssStyles,action);
  content=(RowContent)parent.getReportContent().createRowContent();
  setParent(parent);
  content.setHeight(PropertyUtil.getDimensionAttribute(element,"String_Node_Str"));
  HTML2Content.handleStyle(element,cssStyles,content);
  this.records=records;
  this.index=index;
}
Program: 65786
Project: 65786
Buggy source:
private boolean isUseDimension(String dimensionName){
  boolean inUseDimsion=false;
  CrosstabReportItemHandle crosstab=getCrosstabReportItemHandle();
  int count=crosstab.getDimensionCount(ICrosstabConstants.COLUMN_AXIS_TYPE);
  for (int i=0; i < count; i++) {
    if (crosstab.getDimension(ICrosstabConstants.COLUMN_AXIS_TYPE,i).getCubeDimensionName().equals(dimensionName)) {
      inUseDimsion=true;
    }
  }
  count=crosstab.getDimensionCount(ICrosstabConstants.ROW_AXIS_TYPE);
  for (int i=0; i < count; i++) {
    if (crosstab.getDimension(ICrosstabConstants.ROW_AXIS_TYPE,i).getCubeDimensionName().equals(dimensionName)) {
      inUseDimsion=true;
    }
  }
  return inUseDimsion;
}

Fixed version (ground truth):
private boolean isUseDimension(String dimensionName){
  boolean inUseDimsion=false;
  CrosstabReportItemHandle crosstab=getCrosstabReportItemHandle();
  int count=crosstab.getDimensionCount(ICrosstabConstants.COLUMN_AXIS_TYPE);
  for (int i=0; i < count; i++) {
    if (crosstab.getDimension(ICrosstabConstants.COLUMN_AXIS_TYPE,i).getCubeDimension().getName().equals(dimensionName)) {
      inUseDimsion=true;
    }
  }
  count=crosstab.getDimensionCount(ICrosstabConstants.ROW_AXIS_TYPE);
  for (int i=0; i < count; i++) {
    if (crosstab.getDimension(ICrosstabConstants.ROW_AXIS_TYPE,i).getCubeDimension().getName().equals(dimensionName)) {
      inUseDimsion=true;
    }
  }
  return inUseDimsion;
}
Program: 65787
Project: 65787
Buggy source:
/** 
 * Update value of query text
 * @param queryText
 */
private void updateValuesFromQuery(String queryText){
  if (queryText.length() == 0) {
    validateHasSelectedColumns();
    return;
  }
  if (selectedFile != null && isNewFile(queryText,getFileName(selectedFile))) {
    updateColumnsFromQuery(queryText,selectedFile);
  }
  if (selectedColumnsViewer.getTable().getItemCount() == 0) {
    setPageComplete(false);
    String errMsg=currentSheetName == null ? Messages.getString("String_Node_Str") : Messages.getString("String_Node_Str");
    setMessage(errMsg,ERROR);
  }
}

Fixed version (ground truth):
/** 
 * Update value of query text
 * @param queryText
 */
private void updateValuesFromQuery(String queryText){
  if (queryText.length() == 0) {
    validateHasSelectedColumns();
    return;
  }
  if (selectedFile != null && isNewFile(queryText,getFileName(selectedFile))) {
    updateColumnsFromQuery(queryText,selectedFile);
  }
  if (selectedColumnsViewer.getTable().getItemCount() == 0) {
    setPageComplete(false);
    setMessage(getEmptyColumnErrMsg(),ERROR);
  }
}
Program: 65788
Project: 65788
Buggy source:
private boolean validateHasSelectedColumns(){
  if (selectedColumnsViewer.getTable().getItemCount() == 0 && this.getControl().getShell().getText().startsWith("String_Node_Str")) {
    setPageComplete(false);
    String errMsg=currentSheetName == null ? Messages.getString("String_Node_Str") : Messages.getString("String_Node_Str");
    setMessage(errMsg,ERROR);
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean validateHasSelectedColumns(){
  if (selectedColumnsViewer.getTable().getItemCount() == 0 && this.getControl().getShell().getText().startsWith("String_Node_Str")) {
    setPageComplete(false);
    setMessage(getEmptyColumnErrMsg(),ERROR);
    return false;
  }
  return true;
}
Program: 65789
Project: 65789
Buggy source:
/** 
 * Remove selected columns
 */
private void removeColumns(){
  TableItem[] tis=selectedColumnsViewer.getTable().getSelection();
  int index=selectedColumnsViewer.getTable().getSelectionIndex();
  String[] removedColumnInfo=null;
  java.util.List<String[]> removedItems=new ArrayList<String[]>();
  for (int i=0; i < tis.length; i++) {
    removedColumnInfo=new String[3];
    removedColumnInfo[0]=tis[i].getText(0);
    removedColumnInfo[1]=tis[i].getText(1);
    removedColumnInfo[2]=tis[i].getText(2);
    removedItems.add(removedColumnInfo);
  }
  removeItemsFromSelectedOnes(removedItems);
  selectedColumnsViewer.refresh();
  if (index > 0)   selectedColumnsViewer.getTable().setSelection(index - 1);
 else   selectedColumnsViewer.getTable().setSelection(index);
  if (selectedColumnsViewer.getTable().getSelectionCount() == 0)   btnRemove.setEnabled(false);
  if (savedSelectedColumnsInfoList.size() <= 1) {
    btnMoveDown.setEnabled(false);
    btnMoveUp.setEnabled(false);
  }
  if (selectedColumnsViewer.getTable().getItemCount() == 0) {
    setPageComplete(false);
    String errMsg=currentSheetName == null ? Messages.getString("String_Node_Str") : Messages.getString("String_Node_Str");
    setMessage(errMsg,ERROR);
  }
}

Fixed version (ground truth):
/** 
 * Remove selected columns
 */
private void removeColumns(){
  TableItem[] tis=selectedColumnsViewer.getTable().getSelection();
  int index=selectedColumnsViewer.getTable().getSelectionIndex();
  String[] removedColumnInfo=null;
  java.util.List<String[]> removedItems=new ArrayList<String[]>();
  for (int i=0; i < tis.length; i++) {
    removedColumnInfo=new String[3];
    removedColumnInfo[0]=tis[i].getText(0);
    removedColumnInfo[1]=tis[i].getText(1);
    removedColumnInfo[2]=tis[i].getText(2);
    removedItems.add(removedColumnInfo);
  }
  removeItemsFromSelectedOnes(removedItems);
  selectedColumnsViewer.refresh();
  if (index > 0)   selectedColumnsViewer.getTable().setSelection(index - 1);
 else   selectedColumnsViewer.getTable().setSelection(index);
  if (selectedColumnsViewer.getTable().getSelectionCount() == 0)   btnRemove.setEnabled(false);
  if (savedSelectedColumnsInfoList.size() <= 1) {
    btnMoveDown.setEnabled(false);
    btnMoveUp.setEnabled(false);
  }
  if (selectedColumnsViewer.getTable().getItemCount() == 0) {
    setPageComplete(false);
    setMessage(getEmptyColumnErrMsg(),ERROR);
  }
}
Program: 65791
Project: 65791
Buggy source:
private void populateWorkSheetCombo() throws IOException {
  java.util.List<String> sheetNameList=ExcelFileReader.getSheetNamesInExcelFile(selectedFile);
  worksheetsCombo.setInput(sheetNameList.toArray());
  for (  String sheet : sheetNameList) {
    String queryText=getInitializationDesign().getQueryText();
    if (sheet.equals(currentSheetName) && isNewFile(queryText,getFileName(selectedFile)))     worksheetsCombo.setSelection(new StructuredSelection(currentSheetName));
  }
}

Fixed version (ground truth):
private void populateWorkSheetCombo() throws IOException {
  java.util.List<String> sheetNameList=ExcelFileReader.getSheetNamesInExcelFile(selectedFile);
  worksheetsCombo.setInput(sheetNameList.toArray());
  for (  String sheet : sheetNameList) {
    String queryText=getInitializationDesign().getQueryText();
    if (sheet.equals(currentSheetName) && isNewFile(queryText,getFileName(selectedFile)))     worksheetsCombo.setSelection(new StructuredSelection(currentSheetName));
  }
  if (worksheetsCombo.getSelection().isEmpty())   this.currentSheetName=null;
}
Program: 65794
Project: 65794
Buggy source:
protected void setProvider(IExpressionProvider provider){
  super.setProvider(provider);
}

Fixed version (ground truth):
public void setProvider(IExpressionProvider provider){
  super.setProvider(provider);
}
Program: 65795
Project: 65795
Buggy source:
protected void setProvider(IExpressionProvider provider){
  super.setProvider(provider);
}

Fixed version (ground truth):
public void setProvider(IExpressionProvider provider){
  super.setProvider(provider);
}
Program: 65796
Project: 65796
Buggy source:
private void writeManifest() throws IOException {
  zipStream.putNextEntry(new ZipEntry(MANIFEST_URI));
  ManifestWriter writer=new ManifestWriter(zipStream);
  writer.start(rootMime);
  for (  PackageEntry entry : entries.values()) {
    writer.writeEntry(entry);
  }
  writer.end();
  zipStream.closeEntry();
}

Fixed version (ground truth):
private void writeManifest() throws IOException {
  zipStream.putNextEntry(new ZipEntry(MANIFEST_URI));
  zipStream.write(GetByteArrayFromManifestWriter());
  zipStream.closeEntry();
}
Program: 65797
Project: 65797
Buggy source:
protected void dropSource(Object source) throws SemanticException {
  source=DNDUtil.unwrapToModel(source);
  if (source instanceof Object[]) {
    Object[] array=(Object[])source;
    for (int i=0; i < array.length; i++) {
      dropSource(array[i]);
    }
  }
 else   if (source instanceof StructuredSelection) {
    dropSource(((StructuredSelection)source).toArray());
  }
 else   if (source instanceof DesignElementHandle) {
    dropSourceElementHandle((DesignElementHandle)source);
  }
 else   if (source instanceof EmbeddedImageHandle) {
    dropEmbeddedImageHandle((EmbeddedImageHandle)(source));
  }
 else   if (source instanceof SlotHandle) {
    dropSourceSlotHandle((SlotHandle)source);
  }
 else   if (source instanceof CssStyleSheetHandle) {
    dropCssStyleHandle((CssStyleSheetHandle)source);
  }
}

Fixed version (ground truth):
protected void dropSource(Object source) throws SemanticException {
  source=DNDUtil.unwrapToModel(source);
  if (source instanceof Object[]) {
    Object[] array=(Object[])source;
    for (int i=0; i < array.length; i++) {
      dropSource(array[i]);
    }
  }
 else   if (source instanceof StructuredSelection) {
    dropSource(((StructuredSelection)source).toArray());
  }
 else   if (source instanceof DesignElementHandle) {
    dropSourceElementHandle((DesignElementHandle)source);
  }
 else   if (source instanceof EmbeddedImageHandle) {
    dropEmbeddedImageHandle((EmbeddedImageHandle)(source));
  }
 else   if (source instanceof SlotHandle) {
    dropSourceSlotHandle((SlotHandle)source);
  }
 else   if (source instanceof CssStyleSheetHandle) {
    dropCssStyleHandle((CssStyleSheetHandle)source);
  }
 else   if (source instanceof ScriptObjectNode) {
    ((ScriptObjectNode)source).reset();
  }
}
Program: 65799
Project: 65799
Buggy source:
protected void okPressed(){
  CommandStack stack=getActionStack();
  stack.startTrans(Messages.getString("String_Node_Str"));
  if (input == null) {
    List measureList=new ArrayList();
    List functionList=new ArrayList();
    measureList.addAll(getLevel().getAggregationMeasures());
    functionList.add(getFunctionNames()[0]);
    for (int i=0; i < measureList.size(); i++) {
      functionList.add(getLevel().getAggregationFunction((MeasureViewHandle)measureList.get(i)));
    }
    measureList.add(getMeasure());
    try {
      getLevel().removeSubTotal();
      CrosstabCellHandle cellHandle=getLevel().addSubTotal(measureList,functionList);
      if (cellHandle != null)       CrosstabUIHelper.createSubTotalLabel(getLevel(),cellHandle);
      stack.commit();
    }
 catch (    SemanticException e) {
      stack.rollback();
    }
  }
  super.okPressed();
}

Fixed version (ground truth):
protected void okPressed(){
  CommandStack stack=getActionStack();
  if (input == null) {
    stack.startTrans(Messages.getString("String_Node_Str"));
    List measureList=new ArrayList();
    List functionList=new ArrayList();
    measureList.addAll(getLevel().getAggregationMeasures());
    functionList.add(getFunctionNames()[0]);
    for (int i=0; i < measureList.size(); i++) {
      functionList.add(getLevel().getAggregationFunction((MeasureViewHandle)measureList.get(i)));
    }
    measureList.add(getMeasure());
    try {
      getLevel().removeSubTotal();
      CrosstabCellHandle cellHandle=getLevel().addSubTotal(measureList,functionList);
      if (cellHandle != null)       CrosstabUIHelper.createSubTotalLabel(getLevel(),cellHandle);
      stack.commit();
    }
 catch (    SemanticException e) {
      stack.rollback();
    }
  }
  super.okPressed();
}
Program: 65800
Project: 65800
Buggy source:
private void registerActions(RegisterAction[] actions){
  for (int i=0; i < actions.length; i++) {
    if (actions[i] != null)     addRetargetAction(new RetargetAction(actions[i].id,actions[i].displayName,actions[i].style));
  }
}

Fixed version (ground truth):
private void registerActions(RegisterAction[] actions){
  for (int i=0; i < actions.length; i++) {
    if (actions[i] != null)     addRetargetAction(new ReportRetargetAction(actions[i].id,actions[i].displayName,actions[i].style));
  }
}
Program: 65801
Project: 65801
Buggy source:
@Override public void dispose(){
  if (toggleBreadcrumbAction != null) {
    toggleBreadcrumbAction.dispose();
  }
  super.dispose();
}

Fixed version (ground truth):
@Override public void dispose(){
  if (toggleBreadcrumbAction != null) {
    toggleBreadcrumbAction.dispose();
  }
  if (getActionBars() instanceof SubActionBars) {
    ((SubActionBars)getActionBars()).removePropertyChangeListener(propertyChangeListener);
  }
  super.dispose();
}
Program: 65802
Project: 65802
Buggy source:
private void contributeActionsToMenu(MenuManager menu,RegisterAction[] actions){
  for (int i=0; i < actions.length; i++) {
    if (actions[i] != null) {
      menu.add(getAction(actions[i].id));
    }
 else {
      menu.add(new Separator());
    }
  }
}

Fixed version (ground truth):
private void contributeActionsToMenu(MenuManager menu,RegisterAction[] actions){
  for (int i=0; i < actions.length; i++) {
    if (actions[i] != null) {
      IAction action=getAction(actions[i].id);
      menu.add(action);
    }
 else {
      menu.add(new Separator());
    }
  }
}
Program: 65804
Project: 65804
Buggy source:
private String getPaperTrayCode(int paperTray){
  if (paperTray == TRAYCODE_MANUAL) {
    return "String_Node_Str";
  }
  paperTray=paperTray - 257;
  if (paperTray < 0) {
    return null;
  }
  return "String_Node_Str" + paperTray + "String_Node_Str";
}

Fixed version (ground truth):
private String getPaperTrayCode(String trayCode){
  if (trayCode == null) {
    return null;
  }
  try {
    int paperTray=Integer.parseInt(trayCode);
    if (paperTray == TRAYCODE_MANUAL) {
      return "String_Node_Str";
    }
    paperTray=paperTray - 257;
    if (paperTray < 0) {
      return null;
    }
    return "String_Node_Str" + paperTray + "String_Node_Str";
  }
 catch (  NumberFormatException e) {
    return trayCode;
  }
}
Program: 65805
Project: 65805
Buggy source:
private void setPaperTray(int paperTray){
  String trayString=getPaperTrayCode(paperTray);
  if (trayString != null) {
    out.println("String_Node_Str");
    out.println(trayString);
    out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
private void setPaperTray(String paperTray){
  String trayString=getPaperTrayCode(paperTray);
  if (trayString != null) {
    out.println("String_Node_Str");
    out.println(trayString);
    out.println("String_Node_Str");
  }
}
Program: 65806
Project: 65806
Buggy source:
public void startRenderer(String author,String description,String paperSize,int paperTray,Object duplex,int copies,boolean collate,String resolution,boolean color,int scale,boolean autoPaperSizeSelection,boolean fitToPaper) throws IOException {
  this.scale=scale;
  this.fitToPaper=fitToPaper;
  this.autoPaperSizeSelection=autoPaperSizeSelection;
  if (author != null) {
    out.println("String_Node_Str" + author);
  }
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  setCollate(collate);
  setCopies(copies);
  int[] pageSize=getPaperSize(paperSize);
  if (pageSize != null) {
    int width=pageSize[0];
    int height=pageSize[1];
    setPaperSize(paperSize,width,height);
  }
  setPaperTray(paperTray);
  setDuplex(duplex);
  setResolution(resolution);
  setGray(color);
  FileUtil.load("String_Node_Str",out);
  out.println("String_Node_Str");
  out.println("String_Node_Str");
}

Fixed version (ground truth):
public void startRenderer(String author,String description,String paperSize,String paperTray,Object duplex,int copies,boolean collate,String resolution,boolean color,int scale,boolean autoPaperSizeSelection,boolean fitToPaper) throws IOException {
  this.scale=scale;
  this.fitToPaper=fitToPaper;
  this.autoPaperSizeSelection=autoPaperSizeSelection;
  if (author != null) {
    out.println("String_Node_Str" + author);
  }
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  setCollate(collate);
  setCopies(copies);
  int[] pageSize=getPaperSize(paperSize);
  if (pageSize != null) {
    int width=pageSize[0];
    int height=pageSize[1];
    setPaperSize(paperSize,width,height);
  }
  setPaperTray(paperTray);
  setDuplex(duplex);
  setResolution(resolution);
  setGray(color);
  FileUtil.load("String_Node_Str",out);
  out.println("String_Node_Str");
  out.println("String_Node_Str");
}
Program: 65807
Project: 65807
Buggy source:
public PostscriptPageDevice(RenderOption renderOption,OutputStream output,String title,String author,String description) throws Exception {
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(output);
  writer=new PostscriptWriter(bufferedOutputStream,title);
  String paperSize=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_SIZE);
  int paperTray=renderOption.getIntOption(PostscriptRenderOption.OPTION_PAPER_TRAY,PostscriptWriter.TRAYCODE_AUTO);
  Object duplex=renderOption.getOption(PostscriptRenderOption.OPTION_DUPLEX);
  int copies=renderOption.getIntOption(PostscriptRenderOption.OPTION_COPIES,1);
  boolean collate=renderOption.getBooleanOption(PostscriptRenderOption.OPTION_COLLATE,false);
  String resolution=renderOption.getStringOption(IPostscriptRenderOption.OPTION_RESOLUTION);
  boolean color=renderOption.getBooleanOption(IPostscriptRenderOption.OPTION_COLOR,true);
  int scale=renderOption.getIntOption(IPostscriptRenderOption.OPTION_SCALE,100);
  boolean autoPaperSizeSelection=renderOption.getBooleanOption(IPostscriptRenderOption.OPTION_AUTO_PAPER_SIZE_SELECTION,false);
  boolean fitToPaper=renderOption.getBooleanOption(IPostscriptRenderOption.OPTION_FIT_TO_PAPER,false);
  writer.startRenderer(author,description,paperSize,paperTray,duplex,copies,collate,resolution,color,scale,autoPaperSizeSelection,fitToPaper);
}

Fixed version (ground truth):
public PostscriptPageDevice(RenderOption renderOption,OutputStream output,String title,String author,String description) throws Exception {
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(output);
  writer=new PostscriptWriter(bufferedOutputStream,title);
  String paperSize=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_SIZE);
  String paperTray=renderOption.getStringOption(PostscriptRenderOption.OPTION_PAPER_TRAY);
  Object duplex=renderOption.getOption(PostscriptRenderOption.OPTION_DUPLEX);
  int copies=renderOption.getIntOption(PostscriptRenderOption.OPTION_COPIES,1);
  boolean collate=renderOption.getBooleanOption(PostscriptRenderOption.OPTION_COLLATE,false);
  String resolution=renderOption.getStringOption(IPostscriptRenderOption.OPTION_RESOLUTION);
  boolean color=renderOption.getBooleanOption(IPostscriptRenderOption.OPTION_COLOR,true);
  int scale=renderOption.getIntOption(IPostscriptRenderOption.OPTION_SCALE,100);
  boolean autoPaperSizeSelection=renderOption.getBooleanOption(IPostscriptRenderOption.OPTION_AUTO_PAPER_SIZE_SELECTION,false);
  boolean fitToPaper=renderOption.getBooleanOption(IPostscriptRenderOption.OPTION_FIT_TO_PAPER,false);
  writer.startRenderer(author,description,paperSize,paperTray,duplex,copies,collate,resolution,color,scale,autoPaperSizeSelection,fitToPaper);
}
Program: 65808
Project: 65808
Buggy source:
public String getTooltipText(Object element){
  if (element instanceof Operator) {
    return ((Operator)element).tooltip;
  }
 else   if (element instanceof Expression) {
    return ((Expression)element).tooltip;
  }
 else   if (element instanceof ILocalizableInfo[]) {
    return ((ILocalizableInfo[])element)[1].getToolTip();
  }
 else   if (element instanceof IScriptFunction) {
    return ((IScriptFunction)element).getDescription();
  }
 else   if (element instanceof IScriptFunctionCategory) {
    return ((IScriptFunctionCategory)element).getDescription();
  }
 else   if (element instanceof ComputedColumnHandle) {
    return TOOLTIP_BINDING_PREFIX + ((ComputedColumnHandle)element).getExpression();
  }
 else   if (element instanceof InheritedComputedColumnHandle) {
    return TOOLTIP_BINDING_PREFIX + ((InheritedComputedColumnHandle)element).getHandle().getExpression();
  }
  if (adapterProvider != null) {
    String txt=adapterProvider.getTooltipText(element);
    if (txt != null) {
      return txt;
    }
  }
  return getDisplayText(element);
}

Fixed version (ground truth):
public String getTooltipText(Object element){
  if (element instanceof Operator) {
    return ((Operator)element).tooltip;
  }
 else   if (element instanceof Expression) {
    return ((Expression)element).tooltip;
  }
 else   if (element instanceof ILocalizableInfo[]) {
    return ((ILocalizableInfo[])element)[1].getToolTip();
  }
 else   if (element instanceof IScriptFunction) {
    return ((IScriptFunction)element).getDescription();
  }
 else   if (element instanceof IScriptFunctionCategory) {
    return ((IScriptFunctionCategory)element).getDescription();
  }
 else   if (element instanceof ComputedColumnHandle) {
    return TOOLTIP_BINDING_PREFIX + DataUtil.getAggregationExpression((ComputedColumnHandle)element);
  }
 else   if (element instanceof InheritedComputedColumnHandle) {
    return TOOLTIP_BINDING_PREFIX + ((InheritedComputedColumnHandle)element).getHandle().getExpression();
  }
  if (adapterProvider != null) {
    String txt=adapterProvider.getTooltipText(element);
    if (txt != null) {
      return txt;
    }
  }
  return getDisplayText(element);
}
Program: 65811
Project: 65811
Buggy source:
/** 
 * return all emitter info through BIRT engine emitter extension. If there are several emitters for a same format, then the default emitter specified by EngineConfig is used, if no default emitter is specified in EngineConfig, then the first emitter is used.
 * @return all emitter info through BIRT engine emitter extension
 */
public EmitterInfo[] getEmitterInfo(){
  if (emitterInfos == null) {
    EngineConfig config=engine.getConfig();
    Map<String,EmitterInfo> emitters=new HashMap<String,EmitterInfo>();
    EmitterInfo[] tempEmitterInfo=extensionMgr.getEmitterInfo();
    for (    EmitterInfo emitterInfo : tempEmitterInfo) {
      String format=emitterInfo.getFormat();
      String id=emitterInfo.getID();
      if (!emitters.containsKey(format) || id.equals(config.getDefaultEmitter(format))) {
        emitters.put(format,emitterInfo);
      }
    }
    emitterInfos=new EmitterInfo[emitters.size()];
    emitters.values().toArray(emitterInfos);
    for (    EmitterInfo emitterInfo : emitterInfos) {
      String format=emitterInfo.getFormat();
      String id=emitterInfo.getID();
      String defaultEmitter=config.getDefaultEmitter(format);
      if (defaultEmitter != null && !defaultEmitter.equals(id)) {
        logger.log(Level.WARNING,"String_Node_Str" + defaultEmitter + "String_Node_Str"+ id+ "String_Node_Str"+ format+ "String_Node_Str");
      }
    }
  }
  return emitterInfos;
}

Fixed version (ground truth):
/** 
 * return all emitter info through BIRT engine emitter extension. If there are several emitters for a same format, then the default emitter specified by EngineConfig is used, if no default emitter is specified in EngineConfig, then the first emitter is used.
 * @return all emitter info through BIRT engine emitter extension
 */
public synchronized EmitterInfo[] getEmitterInfo(){
  if (emitterInfos == null) {
    EngineConfig config=engine.getConfig();
    Map<String,EmitterInfo> emitters=new HashMap<String,EmitterInfo>();
    EmitterInfo[] tempEmitterInfo=extensionMgr.getEmitterInfo();
    for (    EmitterInfo emitterInfo : tempEmitterInfo) {
      String format=emitterInfo.getFormat();
      String id=emitterInfo.getID();
      if (!emitters.containsKey(format) || id.equals(config.getDefaultEmitter(format))) {
        emitters.put(format,emitterInfo);
      }
    }
    emitterInfos=new EmitterInfo[emitters.size()];
    emitters.values().toArray(emitterInfos);
    for (    EmitterInfo emitterInfo : emitterInfos) {
      String format=emitterInfo.getFormat();
      String id=emitterInfo.getID();
      String defaultEmitter=config.getDefaultEmitter(format);
      if (defaultEmitter != null && !defaultEmitter.equals(id)) {
        logger.log(Level.WARNING,"String_Node_Str" + defaultEmitter + "String_Node_Str"+ id+ "String_Node_Str"+ format+ "String_Node_Str");
      }
    }
  }
  return emitterInfos;
}