nus-yam/ex-repair huggingface dataset:
Program: 69987
Project: 69987
Buggy source:
void setDataSet(String datasetName){
  try {
    boolean isPreviousDataBindingReference=false;
    if (itemHandle.getDataBindingType() == ReportItemHandle.DATABINDING_TYPE_REPORT_ITEM_REF) {
      isPreviousDataBindingReference=true;
      itemHandle.setDataBindingReference(null);
    }
    itemHandle.setCube(null);
    if (datasetName == null) {
      if (getBoundDataSet() != null) {
        clearBindings();
      }
      itemHandle.setDataSet(null);
    }
 else {
      DataSetHandle dataset=getReportDesignHandle().findDataSet(datasetName);
      if (isPreviousDataBindingReference || itemHandle.getDataSet() != dataset) {
        itemHandle.setDataSet(dataset);
        clearBindings();
        generateBindings(generateComputedColumns(dataset));
      }
    }
  }
 catch (  SemanticException e) {
    WizardBase.showException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
void setDataSet(String datasetName){
  try {
    boolean isPreviousDataBindingReference=false;
    if (itemHandle.getDataBindingType() == ReportItemHandle.DATABINDING_TYPE_REPORT_ITEM_REF) {
      isPreviousDataBindingReference=true;
      itemHandle.setDataBindingReference(null);
    }
    itemHandle.setCube(null);
    if (datasetName == null) {
      if (getBoundDataSet() != null) {
        clearBindings();
      }
      itemHandle.setDataSet(null);
    }
 else {
      DataSetHandle dataset=getReportDesignHandle().findDataSet(datasetName);
      if (isPreviousDataBindingReference || itemHandle.getDataSet() != dataset) {
        itemHandle.setDataSet(dataset);
        clearBindings();
        generateBindings(generateComputedColumns(dataset));
      }
    }
    ChartWizard.removeException(ChartWizard.RepDSProvider_Set_ID);
  }
 catch (  SemanticException e) {
    ChartWizard.showException(ChartWizard.RepDSProvider_Set_ID,e.getLocalizedMessage());
  }
}
Program: 69988
Project: 69988
Buggy source:
public void setStyle(String styleName){
  try {
    if (styleName == null) {
      itemHandle.setStyle(null);
    }
 else {
      itemHandle.setStyle(getStyle(styleName));
    }
  }
 catch (  SemanticException e) {
    WizardBase.showException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void setStyle(String styleName){
  try {
    if (styleName == null) {
      itemHandle.setStyle(null);
    }
 else {
      itemHandle.setStyle(getStyle(styleName));
    }
    ChartWizard.removeException(ChartWizard.RepDSProvider_Style_ID);
  }
 catch (  SemanticException e) {
    ChartWizard.showException(ChartWizard.RepDSProvider_Style_ID,e.getLocalizedMessage());
  }
}
Program: 69989
Project: 69989
Buggy source:
private void switchDataTable(){
  if (isCubeMode()) {
    return;
  }
  Runnable runnable=new Runnable(){
    public void run(){
      ColumnBindingInfo[] headers=null;
      List<?> dataList=null;
      try {
        headers=getDataServiceProvider().getPreviewHeadersInfo();
        dataList=getPreviewData();
        final ColumnBindingInfo[] headerInfo=headers;
        final List<?> data=dataList;
        Display.getDefault().syncExec(new Runnable(){
          public void run(){
            updateTablePreview(headerInfo,data);
            if (errorMsg != null && errorMsg.equals(WizardBase.getErrors())) {
              WizardBase.removeException();
            }
          }
        }
);
      }
 catch (      Exception e) {
        final ColumnBindingInfo[] headerInfo=headers;
        final List<?> data=dataList;
        errorMsg=e.getMessage();
        Display.getDefault().syncExec(new Runnable(){
          public void run(){
            updateTablePreview(headerInfo,data);
            WizardBase.showException(errorMsg);
          }
        }
);
      }
    }
  }
;
  new Thread(runnable).start();
}

Fixed version (ground truth):
private void switchDataTable(){
  if (isCubeMode()) {
    return;
  }
  Runnable runnable=new Runnable(){
    public void run(){
      ColumnBindingInfo[] headers=null;
      List<?> dataList=null;
      try {
        headers=getDataServiceProvider().getPreviewHeadersInfo();
        dataList=getPreviewData();
        final ColumnBindingInfo[] headerInfo=headers;
        final List<?> data=dataList;
        Display.getDefault().syncExec(new Runnable(){
          public void run(){
            updateTablePreview(headerInfo,data);
            ChartWizard.removeException(ChartWizard.StaChartDSh_dPreview_ID);
          }
        }
);
      }
 catch (      Exception e) {
        final ColumnBindingInfo[] headerInfo=headers;
        final List<?> data=dataList;
        final String message=e.getMessage();
        Display.getDefault().syncExec(new Runnable(){
          public void run(){
            updateTablePreview(headerInfo,data);
            ChartWizard.showException(ChartWizard.StaChartDSh_dPreview_ID,message);
          }
        }
);
      }
    }
  }
;
  new Thread(runnable).start();
}
Program: 69990
Project: 69990
Buggy source:
private void updateDragDataSource(){
  if (isCubeMode()) {
    stackLayout.topControl=cmpCubeTree;
    cubeTreeViewer.setInput(getCube());
    cmpStack.layout();
    return;
  }
  String pValue=(previousData == null) ? "String_Node_Str" : previousData;
  String cValue=(currentData == null) ? "String_Node_Str" : currentData;
  if (!pValue.equals(cValue)) {
    getContext().setShowingDataPreview(null);
  }
  previousData=currentData;
  try {
    if (!getContext().isSetShowingDataPreview() && getDataServiceProvider().getPreviewHeadersInfo().length >= 6) {
      getContext().setShowingDataPreview(Boolean.FALSE);
    }
  }
 catch (  NullPointerException e) {
  }
catch (  ChartException e) {
    WizardBase.showException(e.getMessage());
  }
  btnShowDataPreviewA.setSelection(getContext().isShowingDataPreview());
  btnShowDataPreviewB.setSelection(getContext().isShowingDataPreview());
  if (getContext().isShowingDataPreview()) {
    stackLayout.topControl=cmpDataPreview;
  }
 else {
    stackLayout.topControl=cmpColumnsList;
  }
  refreshDataPreviewPane();
  cmpStack.layout();
}

Fixed version (ground truth):
private void updateDragDataSource(){
  if (isCubeMode()) {
    stackLayout.topControl=cmpCubeTree;
    cubeTreeViewer.setInput(getCube());
    cmpStack.layout();
    return;
  }
  String pValue=(previousData == null) ? "String_Node_Str" : previousData;
  String cValue=(currentData == null) ? "String_Node_Str" : currentData;
  if (!pValue.equals(cValue)) {
    getContext().setShowingDataPreview(null);
  }
  previousData=currentData;
  try {
    if (!getContext().isSetShowingDataPreview() && getDataServiceProvider().getPreviewHeadersInfo().length >= 6) {
      getContext().setShowingDataPreview(Boolean.FALSE);
    }
    ChartWizard.removeException(ChartWizard.StaChartDSh_gHeaders_ID);
  }
 catch (  NullPointerException e) {
  }
catch (  ChartException e) {
    ChartWizard.showException(ChartWizard.StaChartDSh_gHeaders_ID,e.getMessage());
  }
  btnShowDataPreviewA.setSelection(getContext().isShowingDataPreview());
  btnShowDataPreviewB.setSelection(getContext().isShowingDataPreview());
  if (getContext().isShowingDataPreview()) {
    stackLayout.topControl=cmpDataPreview;
  }
 else {
    stackLayout.topControl=cmpColumnsList;
  }
  refreshDataPreviewPane();
  cmpStack.layout();
}
Program: 69991
Project: 69991
Buggy source:
/** 
 */
private void refreshColumnsListView(){
  if (dataProvider.getDataSetFromHandle() == null) {
    return;
  }
  if (isCubeMode()) {
    return;
  }
  Runnable runnable=new Runnable(){
    public void run(){
      ColumnBindingInfo[] headers=null;
      List<?> dataList=null;
      try {
        headers=getDataServiceProvider().getPreviewHeadersInfo();
        if (dataProvider.isLivePreviewEnabled()) {
          dataList=getPreviewData();
        }
        final ColumnBindingInfo[] headerInfo=headers;
        final List<?> data=dataList;
        Display.getDefault().syncExec(new Runnable(){
          public void run(){
            updateColumnsTableViewer(headerInfo,data);
            if (errorMsg != null && errorMsg.equals(WizardBase.getErrors())) {
              WizardBase.removeException();
            }
          }
        }
);
      }
 catch (      Exception e) {
        final ColumnBindingInfo[] headerInfo=headers;
        final List<?> data=dataList;
        errorMsg=e.getMessage();
        Display.getDefault().syncExec(new Runnable(){
          public void run(){
            updateColumnsTableViewer(headerInfo,data);
            WizardBase.showException(errorMsg);
          }
        }
);
      }
    }
  }
;
  new Thread(runnable).start();
}

Fixed version (ground truth):
/** 
 */
private void refreshColumnsListView(){
  if (dataProvider.getDataSetFromHandle() == null) {
    return;
  }
  if (isCubeMode()) {
    return;
  }
  Runnable runnable=new Runnable(){
    public void run(){
      ColumnBindingInfo[] headers=null;
      List<?> dataList=null;
      try {
        headers=getDataServiceProvider().getPreviewHeadersInfo();
        if (dataProvider.isLivePreviewEnabled()) {
          dataList=getPreviewData();
        }
        final ColumnBindingInfo[] headerInfo=headers;
        final List<?> data=dataList;
        Display.getDefault().syncExec(new Runnable(){
          public void run(){
            updateColumnsTableViewer(headerInfo,data);
            ChartWizard.removeException(ChartWizard.StaChartDSh_dPreview_ID);
          }
        }
);
      }
 catch (      Exception e) {
        final ColumnBindingInfo[] headerInfo=headers;
        final List<?> data=dataList;
        final String message=e.getLocalizedMessage();
        Display.getDefault().syncExec(new Runnable(){
          public void run(){
            updateColumnsTableViewer(headerInfo,data);
            ChartWizard.showException(ChartWizard.StaChartDSh_dPreview_ID,message);
          }
        }
);
      }
    }
  }
;
  new Thread(runnable).start();
}
Program: 69993
Project: 69993
Buggy source:
protected void addBinding(ComputedColumn column){
  try {
    DEUtil.addColumn(inputElement,column,true);
  }
 catch (  SemanticException e) {
    WizardBase.showException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
protected void addBinding(ComputedColumn column){
  try {
    DEUtil.addColumn(inputElement,column,true);
    ChartWizard.removeException(ChartWizard.ChartColBinDia_ID);
  }
 catch (  SemanticException e) {
    ChartWizard.showException(ChartWizard.ChartColBinDia_ID,e.getLocalizedMessage());
  }
}
Program: 69994
Project: 69994
Buggy source:
private void updatePreview(){
  boolean hasException=false;
  try {
    fsp.updatePreview(getFormatSpecifier());
  }
 catch (  IllegalArgumentException e) {
    ChartWizard.showException(e.getMessage());
    hasException=true;
  }
  if (!hasException) {
    ChartWizard.removeException();
  }
}

Fixed version (ground truth):
private void updatePreview(){
  boolean hasException=false;
  try {
    fsp.updatePreview(getFormatSpecifier());
    ChartWizard.removeException(ChartWizard.FormatSpeciCom_ID);
  }
 catch (  IllegalArgumentException e) {
    ChartWizard.showException(ChartWizard.FormatSpeciCom_ID,e.getMessage());
    hasException=true;
  }
  if (!hasException) {
    ChartWizard.removeException();
  }
}
Program: 69995
Project: 69995
Buggy source:
private void paintMarker(GC gc,Marker currentMarker,Location location){
  Marker renderMarker=currentMarker;
  if (currentMarker.getType() == MarkerType.ICON_LITERAL) {
    renderMarker=currentMarker.copyInstance();
    renderMarker.setFill(ImageImpl.create(UIHelper.getURL("String_Node_Str").toString()));
  }
  idrSWT.setProperty(IDeviceRenderer.GRAPHICS_CONTEXT,gc);
  final MarkerRenderer mr=new MarkerRenderer(idrSWT,StructureSource.createUnknown(null),location,LineAttributesImpl.create(getMarker().isVisible() ? ColorDefinitionImpl.BLUE() : ColorDefinitionImpl.GREY(),LineStyle.SOLID_LITERAL,1),getMarker().isVisible() ? ColorDefinitionImpl.create(80,168,218) : ColorDefinitionImpl.GREY(),renderMarker,Integer.valueOf(4),null,false,false);
  boolean bException=false;
  try {
    mr.draw(idrSWT);
  }
 catch (  ChartException ex) {
    bException=true;
    WizardBase.showException(ex.getLocalizedMessage());
  }
  if (!bException) {
    WizardBase.removeException();
  }
  if (cnvMarker.isFocusControl()) {
    gc.setLineStyle(SWT.LINE_DOT);
    gc.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));
    gc.drawRectangle(0,0,getSize().x - 21,this.getSize().y - 5);
  }
}

Fixed version (ground truth):
private void paintMarker(GC gc,Marker currentMarker,Location location){
  Marker renderMarker=currentMarker;
  if (currentMarker.getType() == MarkerType.ICON_LITERAL) {
    renderMarker=currentMarker.copyInstance();
    renderMarker.setFill(ImageImpl.create(UIHelper.getURL("String_Node_Str").toString()));
  }
  idrSWT.setProperty(IDeviceRenderer.GRAPHICS_CONTEXT,gc);
  final MarkerRenderer mr=new MarkerRenderer(idrSWT,StructureSource.createUnknown(null),location,LineAttributesImpl.create(getMarker().isVisible() ? ColorDefinitionImpl.BLUE() : ColorDefinitionImpl.GREY(),LineStyle.SOLID_LITERAL,1),getMarker().isVisible() ? ColorDefinitionImpl.create(80,168,218) : ColorDefinitionImpl.GREY(),renderMarker,Integer.valueOf(4),null,false,false);
  try {
    mr.draw(idrSWT);
    ChartWizard.removeException(ChartWizard.MarkerEdiCom_ID);
  }
 catch (  ChartException ex) {
    ChartWizard.showException(ChartWizard.MarkerEdiCom_ID,ex.getLocalizedMessage());
  }
  if (cnvMarker.isFocusControl()) {
    gc.setLineStyle(SWT.LINE_DOT);
    gc.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));
    gc.drawRectangle(0,0,getSize().x - 21,this.getSize().y - 5);
  }
}
Program: 69996
Project: 69996
Buggy source:
private void updateQuery(String queryType,Query query,String expr,SeriesDefinition seriesDefinition){
  String actualExpr=expr;
  if (dataProvider.checkState(IDataServiceProvider.SHARE_QUERY)) {
    boolean isGroupOrAggr=false;
    Object obj=getCurrentColumnHeadObject();
    if (obj instanceof ColumnBindingInfo) {
      ColumnBindingInfo cbi=(ColumnBindingInfo)obj;
      int type=cbi.getColumnType();
      if (type == ColumnBindingInfo.GROUP_COLUMN || type == ColumnBindingInfo.AGGREGATE_COLUMN) {
        actualExpr=cbi.getExpression();
        isGroupOrAggr=true;
      }
    }
    if (seriesDefinition != null && (queryType.equals(ChartUIConstants.QUERY_CATEGORY) || queryType.equals(ChartUIConstants.QUERY_VALUE))) {
      seriesDefinition.getGrouping().setEnabled(isGroupOrAggr);
    }
  }
  query.setDefinition(actualExpr);
}

Fixed version (ground truth):
private void updateQuery(String queryType,Query query,String expr,SeriesDefinition seriesDefinition){
  String actualExpr=expr;
  if (dataProvider.checkState(IDataServiceProvider.SHARE_QUERY) || dataProvider.checkState(IDataServiceProvider.INHERIT_COLUMNS_GROUPS)) {
    boolean isGroupOrAggr=false;
    Object obj=getCurrentColumnHeadObject();
    if (obj instanceof ColumnBindingInfo) {
      ColumnBindingInfo cbi=(ColumnBindingInfo)obj;
      int type=cbi.getColumnType();
      if (type == ColumnBindingInfo.GROUP_COLUMN || type == ColumnBindingInfo.AGGREGATE_COLUMN) {
        actualExpr=cbi.getExpression();
        isGroupOrAggr=true;
      }
    }
    if (seriesDefinition != null && (queryType.equals(ChartUIConstants.QUERY_CATEGORY) || queryType.equals(ChartUIConstants.QUERY_VALUE))) {
      seriesDefinition.getGrouping().setEnabled(isGroupOrAggr);
    }
  }
  query.setDefinition(actualExpr);
}
Program: 69997
Project: 69997
Buggy source:
/** 
 * Whether the script string is null or comments
 */
static boolean isNullOrComments(String script){
  if (script == null)   return true;
  String scriptWithoutComments=script.replaceAll("String_Node_Str","String_Node_Str");
  if (scriptWithoutComments.trim().length() == 0)   return true;
 else   return false;
}

Fixed version (ground truth):
/** 
 * Whether the script string is null or comments
 */
static boolean isNullOrComments(String script){
  if (script == null)   return true;
  try {
    String scriptWithoutComments=script.replaceAll("String_Node_Str","String_Node_Str");
    if (scriptWithoutComments.trim().length() == 0)     return true;
 else     return false;
  }
 catch (  Throwable e) {
    return false;
  }
}
Program: 69998
Project: 69998
Buggy source:
public void add(AbstractArea area){
  super.add(area);
  if (repeatList != null) {
    IContent content=((ContainerArea)area).getContent();
    if (content != null) {
      IElement parent=content.getParent();
      if (parent != null && parent instanceof IBandContent) {
        int type=((IBandContent)parent).getBandType();
        if (type == IBandContent.BAND_HEADER || type == IBandContent.BAND_GROUP_HEADER) {
          if (content instanceof IRowContent) {
            RowDesign rowDesign=(RowDesign)content.getGenerateBy();
            if (rowDesign.getRepeatable())             repeatList.add(area);
          }
 else           repeatList.add(area);
        }
      }
    }
  }
}

Fixed version (ground truth):
public void add(AbstractArea area){
  super.add(area);
  if (repeatList != null) {
    IContent content=((ContainerArea)area).getContent();
    if (content != null) {
      IElement parent=content.getParent();
      if (parent != null && parent instanceof IBandContent) {
        int type=((IBandContent)parent).getBandType();
        if (type == IBandContent.BAND_HEADER || type == IBandContent.BAND_GROUP_HEADER) {
          if (content instanceof IRowContent) {
            RowDesign rowDesign=(RowDesign)content.getGenerateBy();
            if (rowDesign != null && rowDesign.getRepeatable()) {
              repeatList.add(area);
            }
          }
 else {
            repeatList.add(area);
          }
        }
      }
    }
  }
}
Program: 70001
Project: 70001
Buggy source:
public int doEndTag() throws JspException {
  try {
    if (!ChartWebHelper.checkOutputType(output)) {
      printError("String_Node_Str" + output + "String_Node_Str");
      return EVAL_PAGE;
    }
    HttpServletRequest request=(HttpServletRequest)pageContext.getRequest();
    if (model instanceof String) {
      String path=(String)model;
      final File chartFile=new File(path);
      if (!chartFile.exists()) {
        path=ChartWebHelper.getRealPath(getServletContext(),path);
      }
      chartModel=ChartWebHelper.parseChart(path);
      if (chartModel == null) {
        printError("String_Node_Str" + model);
        return EVAL_PAGE;
      }
    }
 else     if (model instanceof Chart) {
      chartModel=(Chart)model;
    }
    if (chartModel != null) {
      Bounds bounds=chartModel.getBlock().getBounds();
      bounds.setWidth(width);
      bounds.setHeight(height);
    }
 else {
      printError("String_Node_Str");
      return EVAL_PAGE;
    }
    ChartImageManager imageManager=new ChartImageManager(request.getSession(),chartModel,output,data,runtimeContext,getExternalContext(),styleProcessor);
    File imageFile=imageManager.getImage();
    String imageId=imageFile.getName();
    imageId=imageId.substring(0,imageId.lastIndexOf('.'));
    pageContext.getOut().println(createEmitter(imageId,imageManager.getRelativeImageFolder() + "String_Node_Str" + imageFile.getName(),imageManager.getImageMap()).generateHTML());
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return EVAL_PAGE;
}

Fixed version (ground truth):
public int doEndTag() throws JspException {
  try {
    if (!ChartWebHelper.checkOutputType(output)) {
      printError("String_Node_Str" + output + "String_Node_Str");
      return EVAL_PAGE;
    }
    HttpServletRequest request=(HttpServletRequest)pageContext.getRequest();
    if (model instanceof String) {
      String path=(String)model;
      final File chartFile=new File(path);
      if (!chartFile.exists()) {
        path=ChartWebHelper.getRealPath(getServletContext(),path);
      }
      chartModel=ChartWebHelper.parseChart(path);
      if (chartModel == null) {
        printError("String_Node_Str" + model);
        return EVAL_PAGE;
      }
    }
 else     if (model instanceof Chart) {
      chartModel=(Chart)model;
    }
    if (chartModel != null) {
      Bounds bounds=chartModel.getBlock().getBounds();
      bounds.setWidth(width);
      bounds.setHeight(height);
    }
 else {
      printError("String_Node_Str");
      return EVAL_PAGE;
    }
    ChartImageManager imageManager=new ChartImageManager(request,chartModel,output,data,runtimeContext,getExternalContext(),styleProcessor);
    File imageFile=imageManager.getImage();
    String imageId=imageFile.getName();
    imageId=imageId.substring(0,imageId.lastIndexOf('.'));
    pageContext.getOut().println(createEmitter(imageId,imageManager.getRelativeImageFolder() + "String_Node_Str" + imageFile.getName(),imageManager.getImageMap()).generateHTML());
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return EVAL_PAGE;
}
Program: 70002
Project: 70002
Buggy source:
/** 
 * When session destroyed
 * @see javax.servlet.http.HttpSessionListener#sessionDestroyed(javax.servlet.http.HttpSessionEvent)
 */
public void sessionDestroyed(HttpSessionEvent event){
  String sessionId=event.getSession().getId();
  ChartImageManager.clearSessionFiles(sessionId);
}

Fixed version (ground truth):
/** 
 * When session destroyed
 * @see javax.servlet.http.HttpSessionListener#sessionDestroyed(javax.servlet.http.HttpSessionEvent)
 */
public void sessionDestroyed(HttpSessionEvent event){
  String sessionId=event.getSession().getId();
  ChartImageManager.clearSessionFiles(sessionId,event.getSession().getServletContext());
}
Program: 70003
Project: 70003
Buggy source:
public void contextDestroyed(ServletContextEvent event){
  ChartImageManager.dispose();
}

Fixed version (ground truth):
public void contextDestroyed(ServletContextEvent event){
  ChartImageManager.dispose(event.getServletContext());
}
Program: 70004
Project: 70004
Buggy source:
public String getRelativeImageFolder(){
  return session.getServletContext().getContextPath() + "String_Node_Str" + IMAGE_FOLDER+ "String_Node_Str"+ session.getId();
}

Fixed version (ground truth):
public String getRelativeImageFolder(){
  return request.getContextPath() + "String_Node_Str" + IMAGE_FOLDER+ "String_Node_Str"+ request.getSession().getId();
}
Program: 70005
Project: 70005
Buggy source:
/** 
 * Clear the temp files when session is expired
 * @param id session id
 */
public static void clearSessionFiles(String id){
  if (id == null) {
    return;
  }
  String tempFolder=imageFolder + File.separator + id;
  File file=new File(tempFolder);
  deleteDir(file);
}

Fixed version (ground truth):
/** 
 * Clear the temporary files when session is expired
 * @param id session id
 * @param context sevlet context
 */
public static void clearSessionFiles(String id,ServletContext context){
  if (id == null) {
    return;
  }
  String tempFolder=imageFolder + File.separator + id;
  File file=new File(tempFolder);
  deleteDir(file,context);
}
Program: 70006
Project: 70006
Buggy source:
public ChartImageManager(HttpSession session,Chart chartModel,String outputFormat,IDataRowExpressionEvaluator evaluator,RunTimeContext rtc,IExternalContext externalContext,IStyleProcessor styleProc) throws Exception {
  this.session=session;
  this.cm=chartModel;
  this.sExtension=outputFormat;
  this.evaluator=evaluator;
  this.styleProc=styleProc;
  if (externalContext == null) {
    this.externalContext=new IExternalContext(){
      private static final long serialVersionUID=4666361117214885689L;
      public Object getObject(){
        return null;
      }
      public Scriptable getScriptable(){
        return null;
      }
    }
;
  }
 else {
    this.externalContext=externalContext;
  }
  if (rtc == null) {
    this.rtc=new RunTimeContext();
    this.rtc.setULocale(ULocale.getDefault());
  }
 else {
    this.rtc=rtc;
  }
  sessionIds.add(session.getId());
  generateImage();
}

Fixed version (ground truth):
public ChartImageManager(HttpServletRequest request,Chart chartModel,String outputFormat,IDataRowExpressionEvaluator evaluator,RunTimeContext rtc,IExternalContext externalContext,IStyleProcessor styleProc) throws Exception {
  this.request=request;
  this.cm=chartModel;
  this.sExtension=outputFormat;
  this.evaluator=evaluator;
  this.styleProc=styleProc;
  if (externalContext == null) {
    this.externalContext=new IExternalContext(){
      private static final long serialVersionUID=4666361117214885689L;
      public Object getObject(){
        return null;
      }
      public Scriptable getScriptable(){
        return null;
      }
    }
;
  }
 else {
    this.externalContext=externalContext;
  }
  if (rtc == null) {
    this.rtc=new RunTimeContext();
    this.rtc.setULocale(ULocale.getDefault());
  }
 else {
    this.rtc=rtc;
  }
  sessionIds.add(request.getSession().getId());
  generateImage();
}
Program: 70007
Project: 70007
Buggy source:
/** 
 * Disposes all resources and reset.
 */
public static void dispose(){
  for (int i=0, n=sessionIds.size(); i < n; i++) {
    String sessionId=sessionIds.get(i);
    clearSessionFiles(sessionId);
  }
  sessionIds.clear();
}

Fixed version (ground truth):
/** 
 * Disposes all resources and reset.
 */
public static void dispose(ServletContext context){
  for (int i=0, n=sessionIds.size(); i < n; i++) {
    String sessionId=sessionIds.get(i);
    clearSessionFiles(sessionId,context);
  }
  sessionIds.clear();
}
Program: 70008
Project: 70008
Buggy source:
/** 
 * Deletes all files and subdirectories under dir. Returns true if all deletions were successful. If a deletion fails, the method stops attempting to delete and returns false.
 */
private static boolean deleteDir(File dir){
  if (dir.isDirectory()) {
    String[] children=dir.list();
    for (int i=0; i < children.length; i++) {
      boolean success=deleteDir(new File(dir,children[i]));
      if (!success) {
        return false;
      }
    }
  }
  System.out.println("String_Node_Str" + dir.getPath());
  return dir.delete();
}

Fixed version (ground truth):
/** 
 * Deletes all files and sub-directories under directories. Returns true if all deletions were successful. If a deletion fails, the method stops attempting to delete and returns false.
 */
private static boolean deleteDir(File dir,ServletContext context){
  if (dir.isDirectory()) {
    String[] children=dir.list();
    for (int i=0; i < children.length; i++) {
      boolean success=deleteDir(new File(dir,children[i]),context);
      if (!success) {
        return false;
      }
    }
  }
  context.log("String_Node_Str" + dir.getPath());
  return dir.delete();
}
Program: 70009
Project: 70009
Buggy source:
private void generateImage() throws Exception {
  String imageName=IMAGE_NAME_PREFIX + +imageIndex++ + "String_Node_Str"+ this.sExtension.toLowerCase();
  imageFile=new File(getAbsoluteImageFolder() + File.separator + imageName);
  if (!imageFile.getParentFile().exists()) {
    imageFile.getParentFile().mkdirs();
  }
  System.out.println("String_Node_Str" + imageFile.getPath());
  OutputStream fos=new FileOutputStream(imageFile);
  InputStream fis=generateStream();
  byte[] buffer=new byte[1024];
  int readSize=0;
  while ((readSize=fis.read(buffer)) != -1) {
    fos.write(buffer,0,readSize);
  }
  fis.close();
  fos.close();
}

Fixed version (ground truth):
private void generateImage() throws Exception {
  String imageName=IMAGE_NAME_PREFIX + +imageIndex++ + "String_Node_Str"+ this.sExtension.toLowerCase();
  imageFile=new File(getAbsoluteImageFolder() + File.separator + imageName);
  if (!imageFile.getParentFile().exists()) {
    imageFile.getParentFile().mkdirs();
  }
  request.getSession().getServletContext().log("String_Node_Str" + imageFile.getPath());
  OutputStream fos=new FileOutputStream(imageFile);
  InputStream fis=generateStream();
  byte[] buffer=new byte[1024];
  int readSize=0;
  while ((readSize=fis.read(buffer)) != -1) {
    fos.write(buffer,0,readSize);
  }
  fis.close();
  fos.close();
}
Program: 70010
Project: 70010
Buggy source:
public String getAbsoluteImageFolder(){
  return imageFolder + File.separator + session.getId();
}

Fixed version (ground truth):
public String getAbsoluteImageFolder(){
  return imageFolder + File.separator + request.getSession().getId();
}
Program: 70011
Project: 70011
Buggy source:
/** 
 * Sets default emitter for an output format.
 * @param format the format.
 * @param emitterId the id of the default emitter.
 */
public void setDefaultEmitter(String format,String emitterId){
  defaultEmitterIdsOfFormats.put(format,emitterId);
}

Fixed version (ground truth):
/** 
 * Sets default emitter for an output format.
 * @param format the format.
 * @param emitterId the id of the default emitter.
 */
public void setDefaultEmitter(String format,String emitterId){
  if (format != null) {
    format=format.toLowerCase();
  }
  defaultEmitterIdsOfFormats.put(format,emitterId);
}
Program: 70012
Project: 70012
Buggy source:
/** 
 * Gets default emitter id of an output format.
 * @param format the format.
 * @return the id of the default emitter of this output format, "null" isreturned if default emitter is not set for this format.
 */
public String getDefaultEmitter(String format){
  return defaultEmitterIdsOfFormats.get(format);
}

Fixed version (ground truth):
/** 
 * Gets default emitter id of an output format.
 * @param format the format.
 * @return the id of the default emitter of this output format, "null" isreturned if default emitter is not set for this format.
 */
public String getDefaultEmitter(String format){
  if (format != null) {
    format=format.toLowerCase();
  }
  return defaultEmitterIdsOfFormats.get(format);
}
Program: 70024
Project: 70024
Buggy source:
protected void renderEmptyPlot(IPrimitiveRenderer ipr,Plot p) throws ChartException {
  if (!p.isVisible()) {
    return;
  }
  StructureSource oSource=StructureSource.createPlot(p);
  EventObjectCache eoc=(EventObjectCache)ipr;
  double dScale=getDeviceScale();
  RectangleRenderEvent rre=eoc.getEventObject(oSource,RectangleRenderEvent.class);
  rre.updateFrom(p,dScale);
  ipr.fillRectangle(rre);
  ipr.drawRectangle(rre);
  ClientArea ca=p.getClientArea();
  if (!ca.isVisible()) {
    return;
  }
  Bounds bo=rre.getBounds();
  Insets insPlot=p.getInsets();
  bo=goFactory.adjusteBounds(bo,insPlot);
  if (ca.getShadowColor() != null) {
    rre.setBounds(goFactory.translateBounds(bo,3,3));
    rre.setBackground(ca.getShadowColor());
    ipr.fillRectangle(rre);
  }
  rre.setBounds(bo);
  rre.setOutline(ca.getOutline());
  rre.setBackground(ca.getBackground());
  ipr.fillRectangle(rre);
  if (getModel().getEmptyMessage().isVisible()) {
    Label la=getExternalizedCopy(getModel().getEmptyMessage());
    rendLabelInBounds(ipr,la,oSource,bo);
  }
}

Fixed version (ground truth):
protected void renderEmptyPlot(IPrimitiveRenderer ipr,Plot p,Bounds bo) throws ChartException {
  StructureSource oSource=StructureSource.createPlot(p);
  if (getModel().getEmptyMessage().isVisible()) {
    Label la=getExternalizedCopy(getModel().getEmptyMessage());
    rendLabelInBounds(ipr,la,oSource,bo);
  }
}
Program: 70025
Project: 70025
Buggy source:
public void renderSeries(IPrimitiveRenderer ipr,Plot p,ISeriesRenderingHints isrh) throws ChartException {
  logger.log(ILogger.INFORMATION,Messages.getString("String_Node_Str",new Object[]{getClass().getName(),Integer.valueOf(iSeriesIndex + 1),Integer.valueOf(iSeriesCount)},getRunTimeContext().getULocale()));
}

Fixed version (ground truth):
public void renderSeries(IPrimitiveRenderer ipr,Plot p,ISeriesRenderingHints isrh) throws ChartException {
  Boolean bDataEmpty=rtc.getState(RunTimeContext.StateKey.DATA_EMPTY_KEY);
  if (bDataEmpty == null) {
    bDataEmpty=false;
  }
  Label laAltText=getModel().getEmptyMessage();
  if (bDataEmpty && laAltText.isVisible()) {
    final PlotWithAxes pwa=(PlotWithAxes)getComputations();
    renderEmptyPlot(ipr,p,pwa.getPlotBounds());
  }
 else {
    logger.log(ILogger.INFORMATION,Messages.getString("String_Node_Str",new Object[]{getClass().getName(),Integer.valueOf(iSeriesIndex + 1),Integer.valueOf(iSeriesCount)},getRunTimeContext().getULocale()));
  }
}
Program: 70026
Project: 70026
Buggy source:
private void initGroups(){
  String[] groups=getGroups();
  if (groups.length > 0) {
    cmbGroup.setItems(groups);
    if (binding != null && binding.getAggregateOn() != null) {
      btnGroup.setSelection(true);
      btnTable.setSelection(false);
      if (!isRef)       cmbGroup.setEnabled(true);
      for (int i=0; i < groups.length; i++) {
        if (groups[i].equals(binding.getAggregateOn())) {
          cmbGroup.select(i);
          return;
        }
      }
    }
 else {
      if (this.container instanceof DesignElementHandle && ((DesignElementHandle)this.container).getContainer().getContainer() instanceof TableGroupHandle) {
        TableGroupHandle groupHandle=(TableGroupHandle)((DesignElementHandle)this.container).getContainer().getContainer();
        for (int i=0; i < groups.length; i++) {
          if (groups[i].equals(groupHandle.getName())) {
            cmbGroup.select(i);
          }
        }
        btnTable.setSelection(false);
        btnGroup.setSelection(true);
      }
 else {
        btnTable.setSelection(true);
        btnGroup.setSelection(false);
        cmbGroup.select(0);
        cmbGroup.setEnabled(false);
      }
    }
  }
 else {
    btnGroup.setEnabled(false);
    cmbGroup.setEnabled(false);
    btnTable.setSelection(true);
  }
}

Fixed version (ground truth):
private void initGroups(){
  String[] groups=getGroups();
  if (groups.length > 0) {
    cmbGroup.setItems(groups);
    if (binding != null && binding.getAggregateOn() != null) {
      btnGroup.setSelection(true);
      btnTable.setSelection(false);
      if (!isRef)       cmbGroup.setEnabled(true);
      for (int i=0; i < groups.length; i++) {
        if (groups[i].equals(binding.getAggregateOn())) {
          cmbGroup.select(i);
          return;
        }
      }
    }
 else {
      if (this.container instanceof DesignElementHandle && ((DesignElementHandle)this.container).getContainer().getContainer() instanceof TableGroupHandle) {
        TableGroupHandle groupHandle=(TableGroupHandle)((DesignElementHandle)this.container).getContainer().getContainer();
        for (int i=0; i < groups.length; i++) {
          if (groups[i].equals(groupHandle.getName())) {
            cmbGroup.select(i);
          }
        }
        btnTable.setSelection(false);
        btnGroup.setSelection(true);
      }
 else       if (this.container instanceof ListGroupHandle) {
        ListGroupHandle groupHandle=(ListGroupHandle)this.container;
        for (int i=0; i < groups.length; i++) {
          if (groups[i].equals(groupHandle.getName())) {
            cmbGroup.select(i);
          }
        }
        btnTable.setSelection(false);
        btnGroup.setSelection(true);
      }
 else {
        btnTable.setSelection(true);
        btnGroup.setSelection(false);
        cmbGroup.select(0);
        cmbGroup.setEnabled(false);
      }
    }
  }
 else {
    btnGroup.setEnabled(false);
    cmbGroup.setEnabled(false);
    btnTable.setSelection(true);
  }
}
Program: 70027
Project: 70027
Buggy source:
protected boolean needRepeat(){
  IListContent list=(IListContent)content;
  if (list != null && list.isHeaderRepeat()) {
    IContent header=(IContent)list.getHeader();
    if (header != null && header.getChildren().size() > 0) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
protected boolean needRepeat(){
  IListContent list=(IListContent)content;
  if (list != null && list.isHeaderRepeat()) {
    return true;
  }
  return false;
}
Program: 70028
Project: 70028
Buggy source:
protected boolean needRepeat(){
  IGroupContent group=(IGroupContent)content;
  if (group != null && group.isHeaderRepeat()) {
    IContent header=(IContent)group.getHeader();
    if (header != null && header.getChildren().size() > 0) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
protected boolean needRepeat(){
  IGroupContent group=(IGroupContent)content;
  if (group != null && group.isHeaderRepeat()) {
    return true;
  }
  return false;
}
Program: 70029
Project: 70029
Buggy source:
protected boolean needRepeat(){
  ITableContent table=(ITableContent)content;
  if (table != null && table.isHeaderRepeat()) {
    IContent header=(IContent)table.getHeader();
    if (header != null) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
protected boolean needRepeat(){
  ITableContent table=(ITableContent)content;
  if (table != null && table.isHeaderRepeat()) {
    return true;
  }
  return false;
}
Program: 70030
Project: 70030
Buggy source:
protected boolean needRepeat(){
  IGroupContent group=(IGroupContent)content;
  if (group != null && group.isHeaderRepeat()) {
    IContent header=(IContent)group.getHeader();
    if (header != null && header.getChildren().size() > 0) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
protected boolean needRepeat(){
  IGroupContent group=(IGroupContent)content;
  if (group != null && group.isHeaderRepeat()) {
    return true;
  }
  return false;
}
Program: 70031
Project: 70031
Buggy source:
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(Messages.getString("String_Node_Str"));
    }
  }
  engineConfig=new LauncherEngineConfig();
  engineConfig.setEngineHome(getEngineHome());
  try {
    Platform.startup(engineConfig);
  }
 catch (  BirtException e) {
    throw new Error(Messages.getString("String_Node_Str"));
  }
  IReportEngineFactory factory=(IReportEngineFactory)Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
  configEngine();
  this.engine=factory.createReportEngine(engineConfig);
  engine.changeLogLevel(Level.WARNING);
  initParameters();
}

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(Messages.getString("String_Node_Str"));
    }
  }
  engineConfig=new LauncherEngineConfig();
  engineConfig.setEngineHome(getEngineHome());
  if (getResourceFolder() != null) {
    engineConfig.setResourcePath(getResourceFolder());
  }
  try {
    Platform.startup(engineConfig);
  }
 catch (  BirtException e) {
    throw new Error(Messages.getString("String_Node_Str"));
  }
  IReportEngineFactory factory=(IReportEngineFactory)Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
  configEngine();
  this.engine=factory.createReportEngine(engineConfig);
  engine.changeLogLevel(Level.WARNING);
  initParameters();
}
Program: 70032
Project: 70032
Buggy source:
boolean finalLaunchCheck(final ILaunchConfiguration configuration,String mode,IProgressMonitor monitor) throws CoreException {
  paramValues=new HashMap();
  LauncherEngineConfig engineConfig=new LauncherEngineConfig();
  IReportEngineFactory factory=(IReportEngineFactory)Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
  final IReportEngine engine=factory.createReportEngine(engineConfig);
  engine.changeLogLevel(Level.WARNING);
  final String fileName=covertVariables(configuration.getAttribute(ATTR_REPORT_FILE_NAME,"String_Node_Str"));
  final int taskType=configuration.getAttribute(ATTR_TASK_TYPE,DEFAULT_TASK_TYPE);
  Display display=DebugUI.getStandardDisplay();
  if (display.getThread().equals(Thread.currentThread())) {
    return getParameterValues(getInputParameters(fileName,taskType,engine),paramValues);
  }
  final Object[] result=new Object[]{Boolean.FALSE};
  Runnable r=new Runnable(){
    public void run(){
      result[0]=Boolean.valueOf(getParameterValues(getInputParameters(fileName,taskType,engine),paramValues));
    }
  }
;
  DebugUI.getStandardDisplay().syncExec(r);
  return ((Boolean)result[0]).booleanValue();
}

Fixed version (ground truth):
boolean finalLaunchCheck(final ILaunchConfiguration configuration,String mode,IProgressMonitor monitor) throws CoreException {
  paramValues=new HashMap();
  LauncherEngineConfig engineConfig=new LauncherEngineConfig();
  IReportEngineFactory factory=(IReportEngineFactory)Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
  final IReportEngine engine=factory.createReportEngine(engineConfig);
  engine.changeLogLevel(Level.WARNING);
  final String fileName=covertVariables(configuration.getAttribute(ATTR_REPORT_FILE_NAME,"String_Node_Str"));
  if (getResourceFolder(fileName) != null) {
    engineConfig.setResourcePath(getResourceFolder(fileName));
  }
  final int taskType=configuration.getAttribute(ATTR_TASK_TYPE,DEFAULT_TASK_TYPE);
  Display display=DebugUI.getStandardDisplay();
  if (display.getThread().equals(Thread.currentThread())) {
    return getParameterValues(getInputParameters(fileName,taskType,engine),paramValues);
  }
  final Object[] result=new Object[]{Boolean.FALSE};
  Runnable r=new Runnable(){
    public void run(){
      result[0]=Boolean.valueOf(getParameterValues(getInputParameters(fileName,taskType,engine),paramValues));
    }
  }
;
  DebugUI.getStandardDisplay().syncExec(r);
  return ((Boolean)result[0]).booleanValue();
}
Program: 70033
Project: 70033
Buggy source:
public String[] getVMArguments(ILaunchConfiguration configuration) throws CoreException {
  String[] args=super.getVMArguments(configuration);
  List arguments=new ArrayList();
  for (int i=0; i < args.length; i++) {
    arguments.add(args[i]);
  }
  helper.addPortArgs(arguments);
  helper.addUserClassPath(arguments,configuration);
  helper.addFileNameArgs(arguments);
  helper.addEngineHomeArgs(arguments);
  helper.addTempFolder(arguments);
  helper.addTypeArgs(arguments);
  helper.addParameterArgs(arguments);
  return (String[])arguments.toArray(new String[arguments.size()]);
}

Fixed version (ground truth):
public String[] getVMArguments(ILaunchConfiguration configuration) throws CoreException {
  String[] args=super.getVMArguments(configuration);
  List arguments=new ArrayList();
  for (int i=0; i < args.length; i++) {
    arguments.add(args[i]);
  }
  helper.addPortArgs(arguments);
  helper.addUserClassPath(arguments,configuration);
  helper.addFileNameArgs(arguments);
  helper.addEngineHomeArgs(arguments);
  helper.addResourceFolder(arguments);
  helper.addTempFolder(arguments);
  helper.addTypeArgs(arguments);
  helper.addParameterArgs(arguments);
  return (String[])arguments.toArray(new String[arguments.size()]);
}
Program: 70035
Project: 70035
Buggy source:
protected void writeText(int type,String txt,IContent content,InlineFlag inlineFlag,IStyle computedStyle,IStyle inlineStyle){
  HyperlinkInfo hyper=getHyperlink(content);
  if (content instanceof TextContent) {
    TextFlag textFlag=TextFlag.START;
    String fontFamily=null;
    if ("String_Node_Str".equals(txt)) {
      wordWriter.writeContent(type,txt,computedStyle,inlineStyle,fontFamily,hyper,inlineFlag,textFlag);
    }
 else {
      FontSplitter fontSplitter=getFontSplitter(content);
      while (fontSplitter.hasMore()) {
        Chunk ch=fontSplitter.getNext();
        fontFamily=getFontFamily(computedStyle,ch);
        wordWriter.writeContent(type,ch.getText(),computedStyle,inlineStyle,fontFamily,hyper,inlineFlag,textFlag);
        textFlag=fontSplitter.hasMore() ? TextFlag.MIDDLE : TextFlag.END;
      }
    }
    if (inlineFlag == InlineFlag.BLOCK) {
      wordWriter.writeContent(type,null,computedStyle,inlineStyle,fontFamily,hyper,inlineFlag,TextFlag.END);
    }
  }
 else {
    wordWriter.writeContent(type,txt,computedStyle,inlineStyle,computedStyle.getFontFamily(),hyper,inlineFlag,TextFlag.WHOLE);
  }
}

Fixed version (ground truth):
protected void writeText(int type,String txt,IContent content,InlineFlag inlineFlag,IStyle computedStyle,IStyle inlineStyle){
  HyperlinkInfo hyper=getHyperlink(content);
  if (content instanceof TextContent) {
    TextFlag textFlag=TextFlag.START;
    String fontFamily=null;
    if ("String_Node_Str".equals(txt)) {
      wordWriter.writeContent(type,txt,computedStyle,inlineStyle,fontFamily,hyper,inlineFlag,textFlag);
    }
 else {
      FontSplitter fontSplitter=getFontSplitter(content);
      while (fontSplitter.hasMore()) {
        Chunk ch=fontSplitter.getNext();
        int offset=ch.getOffset();
        int length=ch.getLength();
        fontFamily=getFontFamily(computedStyle,ch);
        wordWriter.writeContent(type,txt.substring(offset,offset + length),computedStyle,inlineStyle,fontFamily,hyper,inlineFlag,textFlag);
        textFlag=fontSplitter.hasMore() ? TextFlag.MIDDLE : TextFlag.END;
      }
    }
    if (inlineFlag == InlineFlag.BLOCK) {
      wordWriter.writeContent(type,null,computedStyle,inlineStyle,fontFamily,hyper,inlineFlag,TextFlag.END);
    }
  }
 else {
    wordWriter.writeContent(type,txt,computedStyle,inlineStyle,computedStyle.getFontFamily(),hyper,inlineFlag,TextFlag.WHOLE);
  }
}
Program: 70036
Project: 70036
Buggy source:
private String getFontFamily(IStyle c_style,Chunk ch){
  String fontFamily;
  FontInfo info=ch.getFontInfo();
  BaseFont basefont=null;
  if (info != null) {
    basefont=info.getBaseFont();
    String[][] fontName=basefont.getFamilyFontName();
    int x=fontName.length - 1;
    int y=fontName[0].length - 1;
    fontFamily=fontName[x][y];
  }
 else {
    fontFamily=c_style.getFontFamily();
  }
  return fontFamily;
}

Fixed version (ground truth):
private String getFontFamily(IStyle c_style,Chunk ch){
  FontInfo info=ch.getFontInfo();
  return info.getFontName();
}
Program: 70037
Project: 70037
Buggy source:
protected void writeRunProperties(IStyle style,String fontFamily,boolean ishyperlink){
  writeHyperlinkStyle(ishyperlink,style);
  writeFont(fontFamily);
  writeFontSize(style);
  writeLetterSpacing(style);
  writeTextLineThrough(style);
  writeFontStyle(style);
  writeFontWeight(style);
}

Fixed version (ground truth):
protected void writeRunProperties(IStyle style,String fontFamily,boolean ishyperlink){
  writeHyperlinkStyle(ishyperlink,style);
  writeFont(fontFamily);
  writeFontSize(style);
  writeLetterSpacing(style);
  writeTextLineThrough(style);
  writeFontStyle(style);
  writeFontWeight(style);
  writer.openTag("String_Node_Str");
  writer.closeTag("String_Node_Str");
}
Program: 70038
Project: 70038
Buggy source:
public void preWindowOpen(){
  IWorkbenchWindowConfigurer configurer=getWindowConfigurer();
  configurer.setShowCoolBar(true);
  configurer.setShowStatusLine(true);
  configurer.setTitle(DesignerWorkbenchMessages.Workbench_title);
}

Fixed version (ground truth):
public void preWindowOpen(){
  IWorkbenchWindowConfigurer configurer=getWindowConfigurer();
  configurer.setShowCoolBar(true);
  configurer.setShowStatusLine(true);
  String title=null;
  IProduct product=Platform.getProduct();
  if (product != null) {
    title=product.getName();
  }
  if (title == null) {
    title=DesignerWorkbenchMessages.Workbench_title;
  }
  configurer.setTitle(title);
}
Program: 70041
Project: 70041
Buggy source:
public static boolean canPreviewWithErrors(ModuleHandle model){
  model.checkReport();
  List list=model.getErrorList();
  if (list.size() > 0) {
    return MessageDialog.openConfirm(Display.getCurrent().getActiveShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
  }
  return true;
}

Fixed version (ground truth):
public static boolean canPreviewWithErrors(ModuleHandle model){
  if (model == null) {
    return false;
  }
  model.checkReport();
  List list=model.getErrorList();
  if (list.size() > 0) {
    return MessageDialog.openConfirm(Display.getCurrent().getActiveShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
  }
  return true;
}