nus-yam/ex-repair huggingface dataset:
Program: 73002
Project: 73002
Buggy source:
public FlipAxisAction(ExtendedItemHandle eih){
  super(Messages.getString("String_Node_Str"),Action.AS_CHECK_BOX);
  this.eih=eih;
  this.cwa=(ChartWithAxes)ChartXTabUtil.getChartFromHandle(eih);
  this.setChecked(cwa.isTransposed());
  this.setEnabled(checkEnabled());
}

Fixed version (ground truth):
public FlipAxisAction(ExtendedItemHandle eih){
  super(Messages.getString("String_Node_Str"),Action.AS_CHECK_BOX);
  this.eih=eih;
  this.setChecked(ChartXTabUIUtil.isTransposedChartWithAxes(ChartXTabUtil.getChartFromHandle(eih)));
  this.setEnabled(checkEnabled());
}
Program: 73003
Project: 73003
Buggy source:
@Override public void run(){
  try {
    AggregationCellHandle containerCell=ChartXTabUtil.getXtabContainerCell(eih);
    if (containerCell != null) {
      List<String> exprs=ChartXTabUtil.getAllLevelsBindingExpression(containerCell.getCrosstab());
      Query query=(Query)((SeriesDefinition)((Axis)cwa.getAxes().get(0)).getSeriesDefinitions().get(0)).getDesignTimeSeries().getDataDefinition().get(0);
      if (cwa.isTransposed()) {
        cwa.setTransposed(false);
        query.setDefinition(exprs.get(0));
        ChartXTabUIUtil.updateXTabForAxis(containerCell,eih,true,cwa);
      }
 else {
        cwa.setTransposed(true);
        query.setDefinition(exprs.get(1));
        ChartXTabUIUtil.updateXTabForAxis(containerCell,eih,false,cwa);
      }
    }
  }
 catch (  BirtException e) {
    ChartWizard.displayException(e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    AggregationCellHandle containerCell=ChartXTabUtil.getXtabContainerCell(eih);
    if (containerCell != null) {
      ChartReportItemImpl reportItem=(ChartReportItemImpl)eih.getReportItem();
      ChartWithAxes cmOld=(ChartWithAxes)reportItem.getProperty(ChartReportItemConstants.PROPERTY_CHART);
      ChartWithAxes cmNew=(ChartWithAxes)EcoreUtil.copy(cmOld);
      List<String> exprs=ChartXTabUtil.getAllLevelsBindingExpression(containerCell.getCrosstab());
      Query query=(Query)((SeriesDefinition)((Axis)cmNew.getAxes().get(0)).getSeriesDefinitions().get(0)).getDesignTimeSeries().getDataDefinition().get(0);
      eih.getRoot().getCommandStack().startTrans(getText());
      if (cmNew.isTransposed()) {
        cmNew.setTransposed(false);
        query.setDefinition(exprs.get(0));
        ChartXTabUIUtil.updateXTabForAxis(containerCell,eih,true,cmNew);
      }
 else {
        cmNew.setTransposed(true);
        query.setDefinition(exprs.get(1));
        ChartXTabUIUtil.updateXTabForAxis(containerCell,eih,false,cmNew);
      }
      reportItem.executeSetModelCommand(eih,cmOld,cmNew);
    }
    eih.getRoot().getCommandStack().commit();
  }
 catch (  BirtException e) {
    ChartWizard.displayException(e);
    eih.getRoot().getCommandStack().rollback();
  }
}
Program: 73004
Project: 73004
Buggy source:
private boolean checkEnabled(){
  try {
    AggregationCellHandle containerCell=ChartXTabUtil.getXtabContainerCell(eih);
    if (containerCell != null) {
      List<String> exprs=ChartXTabUtil.getAllLevelsBindingExpression(containerCell.getCrosstab());
      return exprs.size() == 2 && !ChartXTabUtil.isAggregationCell(containerCell);
    }
  }
 catch (  BirtException e) {
    ChartWizard.displayException(e);
  }
  return false;
}

Fixed version (ground truth):
private boolean checkEnabled(){
  try {
    if (ChartXTabUtil.isAxisChart(eih)) {
      eih=(ExtendedItemHandle)eih.getElementProperty(ChartReportItemConstants.PROPERTY_HOST_CHART);
    }
    if (ChartXTabUtil.isPlotChart(eih)) {
      AggregationCellHandle containerCell=ChartXTabUtil.getXtabContainerCell(eih);
      if (containerCell != null) {
        List<String> exprs=ChartXTabUtil.getAllLevelsBindingExpression(containerCell.getCrosstab());
        return exprs.size() == 2 && !ChartXTabUtil.isAggregationCell(containerCell);
      }
    }
  }
 catch (  BirtException e) {
    ChartWizard.displayException(e);
  }
  return false;
}
Program: 73005
Project: 73005
Buggy source:
public String getColumnText(Object element,int columnIndex){
switch (columnIndex) {
case 0:
    return ((ComputedColumnHandle)element).getName();
case 1:
  return getDataTypeDisplayName(((ComputedColumnHandle)element).getDataType());
case 2:
return ((ComputedColumnHandle)element).getExpression();
case 3:
String ExpValue=((ComputedColumnHandle)element).getFilterExpression();
if (ExpValue != null && ExpValue.length() > 0) {
return ExpValue;
}
 else {
return null;
}
case 4:
String value=DEUtil.getAggregateOn((ComputedColumnHandle)element);
String groupType=DEUtil.getGroupControlType(bindingObject);
String text;
if (value == null) {
if ((ExpressionUtil.hasAggregation(((ComputedColumnHandle)element).getExpression()) && groupType != DEUtil.TYPE_GROUP_NONE) || ((ComputedColumnHandle)element).getAggregateFunction() != null) {
text=ALL;
}
 else text=NONE;
}
 else text=value;
return text;
default :
break;
}
return null;
}

Fixed version (ground truth):
public String getColumnText(Object element,int columnIndex){
switch (columnIndex) {
case 0:
    return ((ComputedColumnHandle)element).getName();
case 1:
  return getDataTypeDisplayName(((ComputedColumnHandle)element).getDataType());
case 2:
return DataUtil.getAggregationExpression((ComputedColumnHandle)element);
case 3:
String ExpValue=((ComputedColumnHandle)element).getFilterExpression();
if (ExpValue != null && ExpValue.length() > 0) {
return ExpValue;
}
 else {
return null;
}
case 4:
String value=DEUtil.getAggregateOn((ComputedColumnHandle)element);
String groupType=DEUtil.getGroupControlType(bindingObject);
String text;
if (value == null) {
if ((ExpressionUtil.hasAggregation(((ComputedColumnHandle)element).getExpression()) && groupType != DEUtil.TYPE_GROUP_NONE) || ((ComputedColumnHandle)element).getAggregateFunction() != null) {
text=ALL;
}
 else text=NONE;
}
 else text=value;
return text;
default :
break;
}
return null;
}
Program: 73006
Project: 73006
Buggy source:
protected String getText(){
  if (!hasBindingFunction()) {
    return super.getText();
  }
  String retValue=getMeasureName();
  if (retValue == null) {
    return super.getText();
  }
  ((LabelFigure)getFigure()).setSpecialPREFIX(PREFIX);
  return PREFIX + "String_Node_Str" + retValue+ "String_Node_Str";
}

Fixed version (ground truth):
protected String getText(){
  String retValue=getMeasureName();
  if (retValue == null) {
    return super.getText();
  }
  ((LabelFigure)getFigure()).setSpecialPREFIX(PREFIX);
  return PREFIX + "String_Node_Str" + retValue+ "String_Node_Str";
}
Program: 73007
Project: 73007
Buggy source:
private String getMeasureName(){
  try {
    DataItemHandle handle=(DataItemHandle)getModel();
    ComputedColumnHandle bindingColumn=DEUtil.getInputBinding(handle,handle.getResultSetColumn());
    DataRequestSession session=DataRequestSession.newSession(new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION));
    return session.getCubeQueryUtil().getReferencedMeasureName(bindingColumn.getExpression());
  }
 catch (  BirtException e) {
    return null;
  }
}

Fixed version (ground truth):
private String getMeasureName(){
  try {
    DataItemHandle handle=(DataItemHandle)getModel();
    ComputedColumnHandle bindingColumn=DEUtil.getInputBinding(handle,handle.getResultSetColumn());
    DataRequestSession session=DataRequestSession.newSession(new DataSessionContext(DataSessionContext.MODE_DIRECT_PRESENTATION));
    return session.getCubeQueryUtil().getReferencedMeasureName(DataUtil.getAggregationExpression(bindingColumn));
  }
 catch (  BirtException e) {
    return null;
  }
}
Program: 73008
Project: 73008
Buggy source:
/** 
 * @param type
 * @return
 */
public static int modelDataTypeToCoreDataType(String type){
  int typeNum=DataType.ANY_TYPE;
  if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(type))   typeNum=DataType.STRING_TYPE;
 else   if (DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(type))   typeNum=DataType.DOUBLE_TYPE;
 else   if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(type))   typeNum=DataType.DECIMAL_TYPE;
 else   if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(type))   typeNum=DataType.DATE_TYPE;
 else   if (DesignChoiceConstants.PARAM_TYPE_BOOLEAN.equals(type))   typeNum=DataType.BOOLEAN_TYPE;
 else   if (DesignChoiceConstants.PARAM_TYPE_INTEGER.equals(type))   typeNum=DataType.INTEGER_TYPE;
  return typeNum;
}

Fixed version (ground truth):
/** 
 * @param type
 * @return
 */
public static int modelDataTypeToCoreDataType(String type){
  int typeNum=DataType.ANY_TYPE;
  if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(type))   typeNum=DataType.STRING_TYPE;
 else   if (DesignChoiceConstants.PARAM_TYPE_FLOAT.equals(type))   typeNum=DataType.DOUBLE_TYPE;
 else   if (DesignChoiceConstants.PARAM_TYPE_DECIMAL.equals(type))   typeNum=DataType.DECIMAL_TYPE;
 else   if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(type))   typeNum=DataType.DATE_TYPE;
 else   if (DesignChoiceConstants.PARAM_TYPE_DATE.equals(type))   typeNum=DataType.SQL_DATE_TYPE;
 else   if (DesignChoiceConstants.PARAM_TYPE_TIME.equals(type))   typeNum=DataType.SQL_TIME_TYPE;
 else   if (DesignChoiceConstants.PARAM_TYPE_BOOLEAN.equals(type))   typeNum=DataType.BOOLEAN_TYPE;
 else   if (DesignChoiceConstants.PARAM_TYPE_INTEGER.equals(type))   typeNum=DataType.INTEGER_TYPE;
  return typeNum;
}
Program: 73009
Project: 73009
Buggy source:
protected EngineTask(ReportEngine engine,int taskType){
  this.engine=engine;
  this.taskType=taskType;
  taskID=id++;
  this.log=engine.getLogger();
  executionContext=new ExecutionContext(this);
  executionContext.setReportContext(new ReportContextImpl(executionContext));
  setAppContext(engine.getConfig().getAppContext());
  cancelFlag=false;
  runningStatus=STATUS_NOT_STARTED;
}

Fixed version (ground truth):
protected EngineTask(ReportEngine engine,int taskType){
  this.engine=engine;
  this.taskType=taskType;
  taskID=id++;
  this.log=engine.getLogger();
  executionContext=new ExecutionContext(this);
  executionContext.setReportContext(new ReportContextImpl(executionContext));
  setAppContext(null);
  cancelFlag=false;
  runningStatus=STATUS_NOT_STARTED;
}
Program: 73010
Project: 73010
Buggy source:
/** 
 * Merges user specified app context to that of EngineTask. The context variables in entry with following keys will be ignored: <ul> <li><code>EngineConstants.APPCONTEXT_CLASSLOADER_KEY</code> <li><code>EngineConstants.WEBAPP_CLASSPATH_KEY</code> <li><code>EngineConstants.PROJECT_CLASSPATH_KEY</code> <li><code>EngineConstants.WORKSPACE_CLASSPATH_KEY</code> </ul>
 * @param from the source app contexts.
 * @param to the destination app contexts.
 */
private void addAppContext(Map from,Map to){
  if (to == null) {
    return;
  }
  Iterator iterator=from.entrySet().iterator();
  while (iterator.hasNext()) {
    Map.Entry entry=(Map.Entry)iterator.next();
    if (!isDeprecatedEntry(entry)) {
      to.put(entry.getKey(),entry.getValue());
    }
  }
}

Fixed version (ground truth):
/** 
 * Merges user specified app context to that of EngineTask. The context variables in entry with following keys will be ignored: <ul> <li><code>EngineConstants.APPCONTEXT_CLASSLOADER_KEY</code> <li><code>EngineConstants.WEBAPP_CLASSPATH_KEY</code> <li><code>EngineConstants.PROJECT_CLASSPATH_KEY</code> <li><code>EngineConstants.WORKSPACE_CLASSPATH_KEY</code> </ul>
 * @param from the source app contexts.
 * @param to the destination app contexts.
 */
private void addAppContext(Map from,Map to){
  if (from == null || to == null) {
    return;
  }
  Iterator iterator=from.entrySet().iterator();
  while (iterator.hasNext()) {
    Map.Entry entry=(Map.Entry)iterator.next();
    if (!isDeprecatedEntry(entry)) {
      to.put(entry.getKey(),entry.getValue());
    }
  }
}
Program: 73014
Project: 73014
Buggy source:
/** 
 * @see org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler#keyPressed(org.eclipse.swt.events.KeyEvent)
 */
public boolean keyPressed(KeyEvent event){
  GraphicalEditPart part=getFocusEditPart();
  if (part instanceof AbstractCellEditPart) {
    return tableCellKeyPressed(event);
  }
  return super.keyPressed(event);
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler#keyPressed(org.eclipse.swt.events.KeyEvent)
 */
public boolean keyPressed(KeyEvent event){
  GraphicalEditPart part=getFocusEditPart();
switch (event.keyCode) {
case SWT.ARROW_LEFT:
case SWT.ARROW_RIGHT:
case SWT.ARROW_UP:
case SWT.ARROW_DOWN:
    if (scrollIncrement(part,event)) {
      return true;
    }
  break;
case SWT.PAGE_DOWN:
case SWT.PAGE_UP:
if (scrollPageIncrement(part,event.keyCode)) {
  return true;
}
break;
default :
break;
}
if (part instanceof AbstractCellEditPart) {
return tableCellKeyPressed(event);
}
return super.keyPressed(event);
}
Program: 73015
Project: 73015
Buggy source:
/** 
 * Populate One AggrDefinition according to given binding name.
 * @param result
 * @param cx
 * @param compiler
 * @param gbc
 * @param name
 * @throws DataException
 */
private void populateOneAggrDefinition(List result,Context cx,ExpressionCompiler compiler,GroupBindingColumn gbc,String name) throws DataException {
  IBinding binding=gbc.getBinding(name);
  if (isAggregationBinding(binding)) {
    List argument=binding.getArguments();
    IAggrFunction aggrFunction=AggregationManager.getInstance().getAggregation(binding.getAggrFunction());
    IBaseExpression[] compiledArgu=populateAggregationArgument(cx,compiler,binding,argument,aggrFunction);
    compiler.compile(binding.getFilter(),cx);
    AggrInfo aggrDefn=new AggrInfo(name,gbc.getGroupLevel(),aggrFunction,compiledArgu,binding.getFilter());
    result.add(aggrDefn);
  }
}

Fixed version (ground truth):
/** 
 * Populate One AggrDefinition according to given binding name.
 * @param result
 * @param cx
 * @param compiler
 * @param gbc
 * @param name
 * @throws DataException
 */
private void populateOneAggrDefinition(List result,Context cx,ExpressionCompiler compiler,GroupBindingColumn gbc,String name) throws DataException {
  IBinding binding=gbc.getBinding(name);
  if (isAggregationBinding(binding)) {
    List argument=new ArrayList(binding.getArguments());
    IAggrFunction aggrFunction=AggregationManager.getInstance().getAggregation(binding.getAggrFunction());
    if (binding.getExpression() != null)     argument.add(0,binding.getExpression());
    IBaseExpression[] compiledArgu=populateAggregationArgument(cx,compiler,binding,argument,aggrFunction);
    compiler.compile(binding.getFilter(),cx);
    AggrInfo aggrDefn=new AggrInfo(name,gbc.getGroupLevel(),aggrFunction,compiledArgu,binding.getFilter());
    result.add(aggrDefn);
  }
}
Program: 73016
Project: 73016
Buggy source:
protected void appendMetaData(IBaseQueryDefinition query){
  Map bindings=query.getBindings();
  Iterator iter=bindings.entrySet().iterator();
  while (iter.hasNext()) {
    Map.Entry entry=(Map.Entry)iter.next();
    String name=(String)entry.getKey();
    IBinding binding=(IBinding)entry.getValue();
    try {
      IBaseExpression expr;
      expr=(IBaseExpression)binding.getExpression();
      int type=expr.getDataType();
      metaEntries.add(new MetaDataEntry(name,type));
    }
 catch (    DataException ex) {
    }
  }
}

Fixed version (ground truth):
protected void appendMetaData(IBaseQueryDefinition query){
  Map bindings=query.getBindings();
  Iterator iter=bindings.entrySet().iterator();
  while (iter.hasNext()) {
    Map.Entry entry=(Map.Entry)iter.next();
    String name=(String)entry.getKey();
    IBinding binding=(IBinding)entry.getValue();
    try {
      metaEntries.add(new MetaDataEntry(name,binding.getDataType()));
    }
 catch (    DataException ex) {
    }
  }
}
Program: 73017
Project: 73017
Buggy source:
protected void addColumBinding(IBaseQueryDefinition transfer,ComputedColumnHandle columnBinding) throws BirtException {
  String name=columnBinding.getName();
  String expr=columnBinding.getExpression();
  String type=columnBinding.getDataType();
  String displayName=columnBinding.getDisplayName();
  int dbType=ModelDteApiAdapter.toDteDataType(type);
  IBaseExpression dbExpr=new ScriptExpression(expr,dbType);
  if (columnBinding.getAggregateOn() != null) {
    dbExpr.setGroupName(columnBinding.getAggregateOn());
  }
  IBinding binding=new Binding(name,dbExpr);
  binding.setDisplayName(displayName);
  if (columnBinding.getAggregateOn() != null)   binding.addAggregateOn(columnBinding.getAggregateOn());
  if (columnBinding.getAggregateFunction() != null) {
    binding.setAggrFunction(DataAdapterUtil.adaptModelAggregationType(columnBinding.getAggregateFunction()));
  }
  String filter=columnBinding.getFilterExpression();
  if (filter != null) {
    binding.setFilter(new ScriptExpression(filter));
  }
  Iterator arguments=columnBinding.argumentsIterator();
  if (arguments != null) {
    while (arguments.hasNext()) {
      AggregationArgumentHandle argumentHandle=(AggregationArgumentHandle)arguments.next();
      String argument=argumentHandle.getValue();
      if (argument != null) {
        binding.addArgument(new ScriptExpression(argument));
      }
    }
  }
  transfer.addBinding(binding);
}

Fixed version (ground truth):
protected void addColumBinding(IBaseQueryDefinition transfer,ComputedColumnHandle columnBinding) throws BirtException {
  String name=columnBinding.getName();
  String expr=columnBinding.getExpression();
  String type=columnBinding.getDataType();
  String displayName=columnBinding.getDisplayName();
  int dbType=ModelDteApiAdapter.toDteDataType(type);
  IBaseExpression dbExpr=expr != null ? new ScriptExpression(expr,dbType) : null;
  if (columnBinding.getAggregateOn() != null) {
    dbExpr.setGroupName(columnBinding.getAggregateOn());
  }
  IBinding binding=new Binding(name,dbExpr);
  binding.setDisplayName(displayName);
  if (columnBinding.getAggregateOn() != null)   binding.addAggregateOn(columnBinding.getAggregateOn());
  if (columnBinding.getAggregateFunction() != null) {
    binding.setAggrFunction(DataAdapterUtil.adaptModelAggregationType(columnBinding.getAggregateFunction()));
  }
  String filter=columnBinding.getFilterExpression();
  if (filter != null) {
    binding.setFilter(new ScriptExpression(filter));
  }
  Iterator arguments=columnBinding.argumentsIterator();
  if (arguments != null) {
    while (arguments.hasNext()) {
      AggregationArgumentHandle argumentHandle=(AggregationArgumentHandle)arguments.next();
      String argument=argumentHandle.getValue();
      if (argument != null) {
        binding.addArgument(new ScriptExpression(argument));
      }
    }
  }
  transfer.addBinding(binding);
}
Program: 73018
Project: 73018
Buggy source:
public Shell createPopupContainer(){
  if (shellPopup != null && !shellPopup.isDisposed()) {
    shellPopup.dispose();
  }
  if (shellPopup == null || shellPopup.isDisposed()) {
    int shellStyle=SWT.DIALOG_TRIM | SWT.RESIZE;
    if (SWT.getPlatform().indexOf("String_Node_Str") < 0) {
      shellStyle|=SWT.APPLICATION_MODAL;
    }
    shellPopup=new Shell(getShell(),shellStyle);
    shellPopup.setLayout(new FillLayout());
  }
  return shellPopup;
}

Fixed version (ground truth):
public Shell createPopupContainer(){
  if (shellPopup != null && !shellPopup.isDisposed()) {
    shellPopup.dispose();
  }
  if (shellPopup == null || shellPopup.isDisposed()) {
    int shellStyle=SWT.DIALOG_TRIM | SWT.RESIZE;
    shellPopup=new Shell(getShell(),shellStyle);
    shellPopup.setLayout(new FillLayout());
  }
  return shellPopup;
}
Program: 73019
Project: 73019
Buggy source:
/** 
 * Determine the report design and doc 's timestamp
 * @param request
 * @throws Exception
 */
protected void processReport(HttpServletRequest request) throws Exception {
  if (ParameterAccessor.HEADER_REQUEST_TYPE_SOAP.equalsIgnoreCase(this.requestType) || IBirtConstants.SERVLET_PATH_DOWNLOAD.equalsIgnoreCase(request.getServletPath()))   return;
  if (this.reportDocumentName == null)   return;
  File reportDocFile=new File(this.reportDocumentName);
  long lastModifiedOfDesign=getLastModifiedOfDesign(request);
  if (lastModifiedOfDesign != -1L && reportDocFile != null && reportDocFile.exists() && reportDocFile.isFile()) {
    if (lastModifiedOfDesign > reportDocFile.lastModified() || ParameterAccessor.isOverwrite(request)) {
      reportDocFile.delete();
    }
  }
}

Fixed version (ground truth):
/** 
 * Determine the report design and doc 's timestamp
 * @param request
 * @throws Exception
 */
protected void processReport(HttpServletRequest request) throws Exception {
  if (ParameterAccessor.HEADER_REQUEST_TYPE_SOAP.equalsIgnoreCase(this.requestType) || IBirtConstants.SERVLET_PATH_DOWNLOAD.equalsIgnoreCase(request.getServletPath()) || IBirtConstants.SERVLET_PATH_EXTRACT.equalsIgnoreCase(request.getServletPath()))   return;
  if (this.reportDocumentName == null)   return;
  File reportDocFile=new File(this.reportDocumentName);
  long lastModifiedOfDesign=getLastModifiedOfDesign(request);
  if (lastModifiedOfDesign != -1L && reportDocFile != null && reportDocFile.exists() && reportDocFile.isFile()) {
    if (lastModifiedOfDesign > reportDocFile.lastModified() || ParameterAccessor.isOverwrite(request)) {
      reportDocFile.delete();
    }
  }
}
Program: 73020
Project: 73020
Buggy source:
protected void drawTableBorder(TableArea table){
}

Fixed version (ground truth):
protected void drawTableBorder(TableArea table){
  TableBorder tb=new TableBorder(table.getX(),table.getY());
  traverseRows(tb,table,tb.tableX,tb.tableY);
  drawBorder(tb);
}
Program: 73022
Project: 73022
Buggy source:
private String[] getMesures(){
  try {
    CrosstabReportItemHandle xtabHandle=(CrosstabReportItemHandle)((ExtendedItemHandle)getBindingHolder()).getReportItem();
    String[] mesures=new String[xtabHandle.getMeasureCount() + 1];
    mesures[0]="String_Node_Str";
    for (int i=1; i < mesures.length; i++) {
      mesures[i]=DEUtil.getExpression(xtabHandle.getMeasure(i - 1).getCubeMeasure());
    }
    return mesures;
  }
 catch (  ExtendedElementException e) {
  }
  return new String[0];
}

Fixed version (ground truth):
private String[] getMesures(){
  try {
    CrosstabReportItemHandle xtabHandle=(CrosstabReportItemHandle)((ExtendedItemHandle)getBindingHolder()).getReportItem();
    List<String> measures=new ArrayList<String>();
    measures.add("String_Node_Str");
    for (int i=0; i < xtabHandle.getMeasureCount(); i++) {
      MeasureViewHandle mv=xtabHandle.getMeasure(i);
      if (mv instanceof ComputedMeasureViewHandle) {
        continue;
      }
      measures.add(DEUtil.getExpression(mv.getCubeMeasure()));
    }
    return measures.toArray(new String[measures.size()]);
  }
 catch (  ExtendedElementException e) {
  }
  return new String[0];
}
Program: 73023
Project: 73023
Buggy source:
/** 
 * Populate the aggregation binding argument. Please note the binding expression will serve as first argument of a binding in case of necessary.
 * @param cx
 * @param compiler
 * @param binding
 * @param argument
 * @param aggrFunction
 * @return
 * @throws DataException
 */
private IBaseExpression[] populateAggregationArgument(Context cx,ExpressionCompiler compiler,IBinding binding,List argument,IAggrFunction aggrFunction) throws DataException {
  int offset=0;
  if (aggrFunction.getParameterDefn().length > 0) {
    offset=1;
  }
  IBaseExpression[] compiledArgu=new IBaseExpression[argument.size() + offset];
  if (offset > 0) {
    compiledArgu[0]=binding.getExpression();
    compiler.compile(compiledArgu[0],cx);
  }
  for (int j=offset; j < argument.size() + offset; j++) {
    IScriptExpression scriptExpr=(IScriptExpression)argument.get(j - offset);
    compiler.compile(scriptExpr,cx);
    compiledArgu[j]=scriptExpr;
  }
  return compiledArgu;
}

Fixed version (ground truth):
/** 
 * Populate the aggregation binding argument. Please note the binding expression will serve as first argument of a binding in case of necessary.
 * @param cx
 * @param compiler
 * @param binding
 * @param argument
 * @param aggrFunction
 * @return
 * @throws DataException
 */
private IBaseExpression[] populateAggregationArgument(Context cx,ExpressionCompiler compiler,IBinding binding,List argument,IAggrFunction aggrFunction) throws DataException {
  IBaseExpression[] compiledArgu=new IBaseExpression[argument.size()];
  for (int j=0; j < argument.size(); j++) {
    IScriptExpression scriptExpr=(IScriptExpression)argument.get(j);
    compiler.compile(scriptExpr,cx);
    compiledArgu[j]=scriptExpr;
  }
  return compiledArgu;
}
Program: 73025
Project: 73025
Buggy source:
public boolean test(Object receiver,String property,Object[] args,Object expectedValue){
  if (property.equals("String_Node_Str")) {
    if (receiver instanceof FileEditorInput) {
      FileEditorInput input=(FileEditorInput)receiver;
      if (input.getFile().getFileExtension().equals(IReportElementConstants.DESIGN_FILE_EXTENSION)) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean test(Object receiver,String property,Object[] args,Object expectedValue){
  if (property.equals("String_Node_Str")) {
    IFile file=null;
    if (receiver instanceof FileEditorInput) {
      FileEditorInput input=(FileEditorInput)receiver;
      if (input.getFile() != null && IReportElementConstants.DESIGN_FILE_EXTENSION.equals(input.getFile().getFileExtension())) {
        return true;
      }
    }
  }
  return false;
}
Program: 73026
Project: 73026
Buggy source:
private void init(){
  if (debugScript) {
    server=new ReportVMServer();
    server.addVMListener(this);
    Context cx=Context.enter();
    try {
      server.start(getRequestPort(),getEventPort(),cx);
    }
 catch (    VMException e1) {
      throw new Error("String_Node_Str");
    }
  }
  engineConfig=new LauncherEngineConfig();
  engineConfig.setEngineHome(getEngineHome());
  try {
    Platform.startup(engineConfig);
  }
 catch (  BirtException e) {
    throw new Error("String_Node_Str");
  }
  IReportEngineFactory factory=(IReportEngineFactory)Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
  configEngine();
  this.engine=factory.createReportEngine(engineConfig);
  engine.changeLogLevel(Level.WARNING);
}

Fixed version (ground truth):
private void init(){
  if (debugScript) {
    server=new ReportVMServer();
    server.addVMListener(this);
    Context cx=Context.enter();
    try {
      server.start(getListenPort(),cx);
    }
 catch (    VMException e1) {
      throw new Error("String_Node_Str");
    }
  }
  engineConfig=new LauncherEngineConfig();
  engineConfig.setEngineHome(getEngineHome());
  try {
    Platform.startup(engineConfig);
  }
 catch (  BirtException e) {
    throw new Error("String_Node_Str");
  }
  IReportEngineFactory factory=(IReportEngineFactory)Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
  configEngine();
  this.engine=factory.createReportEngine(engineConfig);
  engine.changeLogLevel(Level.WARNING);
}
Program: 73027
Project: 73027
Buggy source:
public void connect(InetAddress host,int requestPort,int eventPort) throws VMException {
  try {
    requestSocket=new Socket(host,requestPort);
    requestWriter=new ObjectOutputStream(requestSocket.getOutputStream());
    requestReader=new ObjectInputStream(requestSocket.getInputStream());
    eventSocket=new Socket(host,eventPort);
    eventReader=new ObjectInputStream(eventSocket.getInputStream());
    isTerminated=false;
    isConnected=true;
    logger.info("String_Node_Str");
    addDeferredBreakPoints();
    startEventDispatch();
  }
 catch (  Exception e) {
    throw new VMException(e);
  }
}

Fixed version (ground truth):
public void connect(InetAddress host,int listenPort) throws VMException {
  try {
    requestSocket=new Socket(host,listenPort);
    requestWriter=new ObjectOutputStream(requestSocket.getOutputStream());
    requestReader=new ObjectInputStream(requestSocket.getInputStream());
    eventSocket=new Socket(host,listenPort);
    eventReader=new ObjectInputStream(eventSocket.getInputStream());
    isTerminated=false;
    isConnected=true;
    logger.info("String_Node_Str");
    addDeferredBreakPoints();
    startEventDispatch();
  }
 catch (  Exception e) {
    throw new VMException(e);
  }
}
Program: 73028
Project: 73028
Buggy source:
public void handleEvent(int eventCode,VMContextData context){
  if (isShutdown) {
    return;
  }
synchronized (eventSocket) {
    try {
      logger.info("String_Node_Str" + eventCode + "String_Node_Str"+ EVENT_NAMES[eventCode]);
      clientEventWriter.writeInt(eventCode);
      clientEventWriter.flush();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
  for (int i=0; i < vmListeners.size(); i++) {
    ((VMListener)vmListeners.get(i)).handleEvent(eventCode,context);
  }
}

Fixed version (ground truth):
public void handleEvent(int eventCode,VMContextData context){
  if (isShutdown) {
    return;
  }
synchronized (serverSocket) {
    try {
      logger.info("String_Node_Str" + eventCode + "String_Node_Str"+ EVENT_NAMES[eventCode]);
      clientEventWriter.writeInt(eventCode);
      clientEventWriter.flush();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
  for (int i=0; i < vmListeners.size(); i++) {
    ((VMListener)vmListeners.get(i)).handleEvent(eventCode,context);
  }
}
Program: 73029
Project: 73029
Buggy source:
public void start(int requestPort,int eventPort,Context cx) throws VMException {
  try {
    requestSocket=new ServerSocket(requestPort,50,InetAddress.getLocalHost());
    eventSocket=new ServerSocket(eventPort,50,InetAddress.getLocalHost());
    Socket clientRequestSocket=requestSocket.accept();
    clientRequestReader=new ObjectInputStream(clientRequestSocket.getInputStream());
    clientRequestWriter=new ObjectOutputStream(clientRequestSocket.getOutputStream());
    Socket clientEventSocket=eventSocket.accept();
    clientEventWriter=new ObjectOutputStream(clientEventSocket.getOutputStream());
    logger.info("String_Node_Str");
    isShutdown=false;
    vm.attach(cx,true);
    startRequestDispatch();
  }
 catch (  IOException e) {
    throw new VMException(e);
  }
}

Fixed version (ground truth):
public void start(int listenPort,Context cx) throws VMException {
  try {
    serverSocket=new ServerSocket(listenPort,50,InetAddress.getLocalHost());
    Socket clientRequestSocket=serverSocket.accept();
    clientRequestReader=new ObjectInputStream(clientRequestSocket.getInputStream());
    clientRequestWriter=new ObjectOutputStream(clientRequestSocket.getOutputStream());
    Socket clientEventSocket=serverSocket.accept();
    clientEventWriter=new ObjectOutputStream(clientEventSocket.getOutputStream());
    logger.info("String_Node_Str");
    isShutdown=false;
    vm.attach(cx,true);
    startRequestDispatch();
  }
 catch (  IOException e) {
    throw new VMException(e);
  }
}
Program: 73030
Project: 73030
Buggy source:
private void terminate(){
  if (isShutdown) {
    return;
  }
  isShutdown=true;
  try {
    clientRequestReader.close();
    clientRequestWriter.close();
    clientEventWriter.close();
  }
 catch (  IOException e) {
    logger.warning("String_Node_Str");
  }
  try {
    requestSocket.close();
    eventSocket.close();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  if (requestDispatchThread.isAlive()) {
    requestDispatchThread.interrupt();
  }
  counter=0;
  id2val.clear();
  val2id.clear();
  requestDispatchThread=null;
  clientRequestReader=null;
  clientRequestWriter=null;
  clientEventWriter=null;
  requestSocket=null;
  eventSocket=null;
  logger.info("String_Node_Str");
}

Fixed version (ground truth):
private void terminate(){
  if (isShutdown) {
    return;
  }
  isShutdown=true;
  try {
    clientRequestReader.close();
    clientRequestWriter.close();
    clientEventWriter.close();
  }
 catch (  IOException e) {
    logger.warning("String_Node_Str");
  }
  try {
    serverSocket.close();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  if (requestDispatchThread.isAlive()) {
    requestDispatchThread.interrupt();
  }
  counter=0;
  id2val.clear();
  val2id.clear();
  requestDispatchThread=null;
  clientRequestReader=null;
  clientRequestWriter=null;
  clientEventWriter=null;
  serverSocket=null;
  logger.info("String_Node_Str");
}
Program: 73031
Project: 73031
Buggy source:
public static void main(String[] args){
  RemoteRunner runner=new RemoteRunner();
  Thread debugthread=new Thread(runner,"String_Node_Str");
  debugthread.start();
  System.out.println("String_Node_Str");
  ReportVMClient client=new ReportVMClient();
  runner.client=client;
  client.addVMListener(runner);
  runner.installBreakpoints();
  try {
    client.connect(10000,10001);
    System.out.println("String_Node_Str");
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  RemoteRunner runner=new RemoteRunner();
  Thread debugthread=new Thread(runner,"String_Node_Str");
  debugthread.start();
  System.out.println("String_Node_Str");
  ReportVMClient client=new ReportVMClient();
  runner.client=client;
  client.addVMListener(runner);
  runner.installBreakpoints();
  try {
    client.connect(10000);
    System.out.println("String_Node_Str");
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 73032
Project: 73032
Buggy source:
public void run(){
  try {
    System.out.println("String_Node_Str");
    server=new ReportVMServer();
    Context cx=Context.enter();
    server.start(10000,10001,cx);
    System.out.println("String_Node_Str");
    Scriptable global=new ImporterTopLevel();
    cx.evaluateString(global,"String_Node_Str","String_Node_Str",0,null);
    cx.evaluateString(global,"String_Node_Str","String_Node_Str",0,null);
    cx.evaluateString(global,"String_Node_Str","String_Node_Str",0,null);
    server.shutdown(cx);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void run(){
  try {
    System.out.println("String_Node_Str");
    server=new ReportVMServer();
    Context cx=Context.enter();
    server.start(10000,cx);
    System.out.println("String_Node_Str");
    Scriptable global=new ImporterTopLevel();
    cx.evaluateString(global,"String_Node_Str","String_Node_Str",0,null);
    cx.evaluateString(global,"String_Node_Str","String_Node_Str",0,null);
    cx.evaluateString(global,"String_Node_Str","String_Node_Str",0,null);
    server.shutdown(cx);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 73033
Project: 73033
Buggy source:
/** 
 * Contructor
 * @param launch
 * @param vm
 * @param name
 * @param process
 * @param requestPort
 * @param eventPort
 * @param tempFolder
 */
public ScriptDebugTarget(ILaunch launch,ReportVMClient vm,String name,IProcess process,int requestPort,int eventPort,String tempFolder){
  super(null);
  this.launch=launch;
  this.reportVM=vm;
  this.name=name;
  this.process=process;
  this.tempFolder=tempFolder;
  this.requestPort=requestPort;
  this.eventPort=eventPort;
  launch.addDebugTarget(this);
  vm.addVMListener(this);
  setTerminating(false);
  setTerminated(false);
  thread=new ScriptDebugThread(this);
  threads=new IThread[]{thread};
  DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
  while (!isTerminated()) {
    try {
      vm.connect(requestPort,eventPort);
      break;
    }
 catch (    VMException e) {
      continue;
    }
  }
}

Fixed version (ground truth):
/** 
 * Contructor
 * @param launch
 * @param vm
 * @param name
 * @param process
 * @param listenPort
 * @param eventPort
 * @param tempFolder
 */
public ScriptDebugTarget(ILaunch launch,ReportVMClient vm,String name,IProcess process,int listenPort,String tempFolder){
  super(null);
  this.launch=launch;
  this.reportVM=vm;
  this.name=name;
  this.process=process;
  this.tempFolder=tempFolder;
  this.listenPort=listenPort;
  launch.addDebugTarget(this);
  vm.addVMListener(this);
  setTerminating(false);
  setTerminated(false);
  thread=new ScriptDebugThread(this);
  threads=new IThread[]{thread};
  DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
  while (!isTerminated()) {
    try {
      vm.connect(listenPort);
      break;
    }
 catch (    VMException e) {
      continue;
    }
  }
}
Program: 73034
Project: 73034
Buggy source:
private String getDefaultName(){
  return "String_Node_Str" + requestPort + "String_Node_Str"+ eventPort;
}

Fixed version (ground truth):
private String getDefaultName(){
  return "String_Node_Str" + listenPort;
}
Program: 73035
Project: 73035
Buggy source:
public void run(VMRunnerConfiguration configuration,ILaunch launch,IProgressMonitor monitor) throws CoreException {
  delegate.run(configuration,launch,monitor);
  IProcess[] ps=launch.getProcesses();
  if (ps != null && ps.length > 0) {
    if (runScript) {
      if (monitor == null) {
        monitor=new NullProgressMonitor();
      }
      IProgressMonitor subMonitor=new SubProgressMonitor(monitor,1);
      subMonitor.beginTask("String_Node_Str",1);
      ReportVMClient vm=new ReportVMClient();
      ScriptDebugTarget target=new ScriptDebugTarget(launch,vm,null,ps[0],config.helper.requestPort,config.helper.eventPort,config.helper.tempFolder);
      target.setFileName(config.helper.fileName);
      subMonitor.worked(1);
      subMonitor.done();
    }
    ReportLaunchHelper.handleProcessTermination(launch,ps[0],config.helper.fileName,config.helper.tempFolder);
  }
}

Fixed version (ground truth):
public void run(VMRunnerConfiguration configuration,ILaunch launch,IProgressMonitor monitor) throws CoreException {
  delegate.run(configuration,launch,monitor);
  IProcess[] ps=launch.getProcesses();
  if (ps != null && ps.length > 0) {
    if (runScript) {
      if (monitor == null) {
        monitor=new NullProgressMonitor();
      }
      IProgressMonitor subMonitor=new SubProgressMonitor(monitor,1);
      subMonitor.beginTask("String_Node_Str",1);
      ReportVMClient vm=new ReportVMClient();
      ScriptDebugTarget target=new ScriptDebugTarget(launch,vm,null,ps[0],config.helper.listenPort,config.helper.tempFolder);
      target.setFileName(config.helper.fileName);
      subMonitor.worked(1);
      subMonitor.done();
    }
    ReportLaunchHelper.handleProcessTermination(launch,ps[0],config.helper.fileName,config.helper.tempFolder);
  }
}
Program: 73036
Project: 73036
Buggy source:
void addPortArgs(List list){
  requestPort=findFreePort();
  eventPort=findFreePort();
  list.add("String_Node_Str" + ATTR_REQUEST_PORT + "String_Node_Str"+ requestPort);
  list.add("String_Node_Str" + ATTR_EVENT_PORT + "String_Node_Str"+ eventPort);
}

Fixed version (ground truth):
void addPortArgs(List list){
  listenPort=findFreePort();
  list.add("String_Node_Str" + ATTR_LISTEN_PORT + "String_Node_Str"+ listenPort);
}
Program: 73039
Project: 73039
Buggy source:
/** 
 * @see org.eclipse.birt.report.service.api.IViewerReportService#extractData(java.lang.String,org.eclipse.birt.report.service.api.InputOptions,java.io.OutputStream)
 */
public void extractData(String docName,InputOptions options,OutputStream out) throws ReportServiceException {
  IReportDocument doc=ReportEngineService.getInstance().openReportDocument(getReportDesignName(options),docName,getModuleOptions(options));
  if (doc == null) {
    throw new ReportServiceException(BirtResources.getMessage(ResourceConstants.REPORT_SERVICE_EXCEPTION_EXTRACT_DATA_NO_DOCUMENT));
  }
  Locale locale=(Locale)options.getOption(InputOptions.OPT_LOCALE);
  HttpServletRequest request=(HttpServletRequest)options.getOption(InputOptions.OPT_REQUEST);
  try {
    String extractFormat=ParameterAccessor.getExtractFormat(request);
    String extractExtension=ParameterAccessor.getExtractExtension(request);
    String resultSetName=ParameterAccessor.getResultSetName(request);
    String instanceId=ParameterAccessor.getIId(request);
    Collection columns=ParameterAccessor.getSelectedColumns(request);
    Map paramMap=ParameterAccessor.getParameterAsMap(request);
    ReportEngineService.getInstance().extractDataEx(doc,extractFormat,extractExtension,resultSetName,instanceId,columns,locale,paramMap,out);
  }
 catch (  RemoteException e) {
    throw new ReportServiceException(e.getLocalizedMessage(),e.getCause());
  }
 finally {
    if (doc != null)     doc.close();
  }
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.birt.report.service.api.IViewerReportService#extractData(java.lang.String,org.eclipse.birt.report.service.api.InputOptions,java.io.OutputStream)
 */
public void extractData(String docName,InputOptions options,OutputStream out) throws ReportServiceException {
  IReportDocument doc=ReportEngineService.getInstance().openReportDocument(getReportDesignName(options),docName,getModuleOptions(options));
  if (doc == null) {
    throw new ReportServiceException(BirtResources.getMessage(ResourceConstants.REPORT_SERVICE_EXCEPTION_EXTRACT_DATA_NO_DOCUMENT));
  }
  Locale locale=(Locale)options.getOption(InputOptions.OPT_LOCALE);
  HttpServletRequest request=(HttpServletRequest)options.getOption(InputOptions.OPT_REQUEST);
  try {
    String extractFormat=ParameterAccessor.getExtractFormat(request);
    String extractExtension=ParameterAccessor.getExtractExtension(request);
    String resultSetName=ParameterAccessor.getResultSetName(request);
    String instanceId=ParameterAccessor.getInstanceId(request);
    Collection columns=ParameterAccessor.getSelectedColumns(request);
    Map paramMap=ParameterAccessor.getParameterAsMap(request);
    ReportEngineService.getInstance().extractDataEx(doc,extractFormat,extractExtension,resultSetName,instanceId,columns,locale,paramMap,out);
  }
 catch (  RemoteException e) {
    throw new ReportServiceException(e.getLocalizedMessage(),e.getCause());
  }
 finally {
    if (doc != null)     doc.close();
  }
}
Program: 73040
Project: 73040
Buggy source:
void addSortCondition(ISortCondition sort) throws SemanticException ;

Fixed version (ground truth):
void addSortCondition(ISortElement sort) throws SemanticException ;
Program: 73041
Project: 73041
Buggy source:
void removeSortCondition(ISortCondition sort) throws SemanticException ;

Fixed version (ground truth):
void removeSortCondition(ISortElement sort) throws SemanticException ;
Program: 73042
Project: 73042
Buggy source:
public void addFilterCondition(IFilterConditionElement filter) throws SemanticException {
}

Fixed version (ground truth):
public void addFilterCondition(IFilterConditionElement filter) throws SemanticException {
  FilterConditionElementHandle fceh=lv.getModelHandle().getElementFactory().newFilterConditionElement();
  fceh.setExpr(filter.getExpr());
  fceh.setFilterTarget(filter.getFilterTarget());
  fceh.setOperator(filter.getOperator());
  fceh.setValue1(filter.getValue1List());
  fceh.setValue2(filter.getValue2());
  fceh.setOptional(filter.isOptional());
  lv.getModelHandle().add(ILevelViewConstants.FILTER_PROP,fceh);
}
Program: 73043
Project: 73043
Buggy source:
public void addSortCondition(ISortCondition sort) throws SemanticException {
}

Fixed version (ground truth):
public void addSortCondition(ISortElement sort) throws SemanticException {
  SortElementHandle seh=lv.getModelHandle().getElementFactory().newSortElement();
  seh.setDirection(sort.getDirection());
  seh.setKey(sort.getKey());
  lv.getModelHandle().add(ILevelViewConstants.SORT_PROP,seh);
}
Program: 73044
Project: 73044
Buggy source:
public void removeSortCondition(ISortCondition sort) throws SemanticException {
}

Fixed version (ground truth):
public void removeSortCondition(ISortElement sort) throws SemanticException {
  if (sort == null) {
    return;
  }
  SortElementHandle handle=null;
  for (Iterator itr=lv.sortsIterator(); itr.hasNext(); ) {
    SortElementHandle seh=(SortElementHandle)itr.next();
    if (equalSort(seh,sort)) {
      handle=seh;
      break;
    }
  }
  if (handle != null) {
    lv.getModelHandle().drop(ILevelViewConstants.SORT_PROP,handle);
  }
}
Program: 73045
Project: 73045
Buggy source:
public void removeFilterCondition(IFilterConditionElement filter) throws SemanticException {
}

Fixed version (ground truth):
public void removeFilterCondition(IFilterConditionElement filter) throws SemanticException {
  if (filter == null) {
    return;
  }
  FilterConditionElementHandle handle=null;
  for (Iterator itr=lv.filtersIterator(); itr.hasNext(); ) {
    FilterConditionElementHandle feh=(FilterConditionElementHandle)itr.next();
    if (equalFilter(feh,filter)) {
      handle=feh;
      break;
    }
  }
  if (handle != null) {
    lv.getModelHandle().drop(ILevelViewConstants.FILTER_PROP,handle);
  }
}
Program: 73047
Project: 73047
Buggy source:
public PDFPageDevice(OutputStream output,String title,IReportContext context,IReportContent report){
  this.context=context;
  this.report=report;
  doc=new Document();
  try {
    writer=PdfWriter.getInstance(doc,new BufferedOutputStream(output));
    String creator="String_Node_Str" + BundleVersionUtil.getBundleVersion("String_Node_Str") + "String_Node_Str"+ BundleVersionUtil.getBundleVersion("String_Node_Str");
    doc.addCreator(creator);
    if (null != title)     doc.addTitle(title);
  }
 catch (  DocumentException de) {
    logger.log(Level.SEVERE,de.getMessage(),de);
  }
}

Fixed version (ground truth):
/** 
 * constructor for test
 * @param output
 */
public PDFPageDevice(OutputStream output){
  doc=new Document();
  try {
    writer=PdfWriter.getInstance(doc,new BufferedOutputStream(output));
  }
 catch (  DocumentException de) {
    logger.log(Level.SEVERE,de.getMessage(),de);
  }
}
Program: 73048
Project: 73048
Buggy source:
public static String createTempRootDir(String tempDir){
  String rootDirStr=null;
  File tempDtEDir=null;
synchronized (cacheCounter1) {
    tempDtEDir=new File(tempDir,"String_Node_Str" + System.currentTimeMillis() + cacheCounter1);
    cacheCounter1=new Integer(cacheCounter1.intValue() + 1);
    int x=0;
    while (tempDtEDir.exists()) {
      x++;
      tempDtEDir=new File(tempDir,"String_Node_Str" + System.currentTimeMillis() + cacheCounter1+ "String_Node_Str"+ x);
    }
    tempDtEDir.mkdirs();
    tempDtEDir.deleteOnExit();
  }
  rootDirStr=getCanonicalPath(tempDtEDir);
  return rootDirStr;
}

Fixed version (ground truth):
public static String createTempRootDir(String tempDir){
  String rootDirStr=null;
  File tempDtEDir=null;
  tempDtEDir=new File(tempDir,"String_Node_Str" + System.currentTimeMillis() + cacheCounter1);
  cacheCounter1.add(1);
  int x=0;
  while (tempDtEDir.exists()) {
    x++;
    tempDtEDir=new File(tempDir,"String_Node_Str" + System.currentTimeMillis() + cacheCounter1+ "String_Node_Str"+ x);
  }
  tempDtEDir.mkdirs();
  tempDtEDir.deleteOnExit();
  rootDirStr=getCanonicalPath(tempDtEDir);
  return rootDirStr;
}
Program: 73049
Project: 73049
Buggy source:
/** 
 * @return session temp dir
 * @throws DataException 
 * @throws IOException 
 */
public static String createSessionTempDir(String tempRootDir) throws DataException {
  final String prefix="String_Node_Str";
  File sessionFile=null;
synchronized (cacheCounter2) {
    String sessionTempDir=tempRootDir + File.separator + prefix+ System.currentTimeMillis()+ cacheCounter2.intValue();
    cacheCounter2=new Integer(cacheCounter2.intValue() + 1);
    sessionFile=new File(sessionTempDir);
    int i=0;
    while (sessionFile.exists() || !sessionFile.mkdirs()) {
      i++;
      sessionTempDir=sessionTempDir + "String_Node_Str" + i;
      sessionFile=new File(sessionTempDir);
      if (i > MAX_DIR_CREATION_ATTEMPT)       throw new DataException(ResourceConstants.FAIL_TO_CREATE_TEMP_DIR,sessionFile.getAbsolutePath());
    }
    sessionFile.deleteOnExit();
  }
  return getCanonicalPath(sessionFile);
}

Fixed version (ground truth):
/** 
 * @return session temp dir
 * @throws DataException 
 * @throws IOException 
 */
public static String createSessionTempDir(String tempRootDir) throws DataException {
  final String prefix="String_Node_Str";
  File sessionFile=null;
  String sessionTempDir=tempRootDir + File.separator + prefix+ System.currentTimeMillis()+ cacheCounter2.intValue();
  cacheCounter2.add(1);
  sessionFile=new File(sessionTempDir);
  int i=0;
  String tempDir=sessionTempDir;
  while (sessionFile.exists()) {
    i++;
    sessionTempDir=tempDir + "String_Node_Str" + i;
    sessionFile=new File(sessionTempDir);
    if (i > MAX_DIR_CREATION_ATTEMPT) {
      throw new DataException(ResourceConstants.FAIL_TO_CREATE_TEMP_DIR,diagnosticMkdirs(sessionFile));
    }
  }
  if (!sessionFile.mkdirs()) {
    throw new DataException(ResourceConstants.FAIL_TO_CREATE_TEMP_DIR,diagnosticMkdirs(sessionFile));
  }
  sessionFile.deleteOnExit();
  return getCanonicalPath(sessionFile);
}